【CSS3】8款好看的純CSS3搜索框:
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>8款純CSS3搜索框</title>
<link href="http://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
background: #494A5F;
font-weight: 500;
font-family: "Microsoft YaHei","宋體","Segoe UI", "Lucida Grande", Helvetica, Arial,sans-serif, FreeSans, Arimo;
}
#container {
width: 500px;
height: 820px;
margin: 0 auto;
}
div.search {padding: 30px 0;}
form {
position: relative;
width: 300px;
margin: 0 auto;
}
input, button {
border: none;
outline: none;
}
input {
width: 100%;
height: 42px;
padding-left: 13px;
}
button {
height: 42px;
width: 42px;
cursor: pointer;
position: absolute;
}
/*搜索框1*/
.bar1 {background: #A3D0C3;}
.bar1 input {
border: 2px solid #7BA7AB;
border-radius: 5px;
background: #F9F0DA;
color: #9E9C9C;
}
.bar1 button {
top: 0;
right: 0;
background: #7BA7AB;
border-radius: 0 5px 5px 0;
}
.bar1 button:before {
content: "\f002";
font-family: FontAwesome;
font-size: 16px;
color: #F9F0DA;
}
/*搜索框2*/
.bar2 {background: #DABB52;}
.bar2 input, .bar2 button {
border-radius: 3px;
}
.bar2 input {
background: #F9F0DA;
}
.bar2 button {
height: 26px;
width: 26px;
top: 8px;
right: 8px;
background: #F15B42;
}
.bar2 button:before {
content: "\f105";
font-family: FontAwesome;
color: #F9F0DA;
font-size: 20px;
font-weight: bold;
}
/*搜索框3*/
.bar3 {background: #F9F0DA;}
.bar3 form {background: #A3D0C3;}
.bar3 input, .bar3 button {
background: transparent;
}
.bar3 button {
top: 0;
right: 0;
}
.bar3 button:before {
content: "\f002";
font-family: FontAwesome;
font-size: 16px;
color: #F9F0DA;
}
/*搜索框4*/
.bar4 {background: #F15B42;}
.bar4 form {
background: #F9F0DA;
border-bottom: 2px solid #BE290E;
}
.bar4 input, .bar4 button {
background: transparent;
}
.bar4 button {
top: 0;
right: 0;
}
.bar4 button:before {
content: "\f178";
font-family: FontAwesome;
font-size: 20px;
color: #be290e;
}
/*搜索框5*/
.bar5 {background: #683B4D;}
.bar5 input, .bar5 button {
background: transparent;
}
.bar5 input {
border: 2px solid #F9F0DA;
}
.bar5 button {
top: 0;
right: 0;
}
.bar5 button:before {
content: "\f002";
font-family: FontAwesome;
font-size: 16px;
color: #F9F0DA;
}
.bar5 input:focus {
border-color: #311c24
}
/*搜索框6*/
.bar6 {background: #F9F0DA;}
.bar6 input {
border: 2px solid #c5464a;
border-radius: 5px;
background: transparent;
top: 0;
right: 0;
}
.bar6 button {
background: #c5464a;
border-radius: 0 5px 5px 0;
width: 60px;
top: 0;
right: 0;
}
.bar6 button:before {
content: "搜索";
font-size: 13px;
color: #F9F0DA;
}
/*搜索框7*/
.bar7 {background: #7BA7AB;}
.bar7 form {
height: 42px;
}
.bar7 input {
width: 250px;
border-radius: 42px;
border: 2px solid #324B4E;
background: #F9F0DA;
transition: .3s linear;
float: right;
}
.bar7 input:focus {
width: 300px;
}
.bar7 button {
background: none;
top: -2px;
right: 0;
}
.bar7 button:before{
content: "\f002";
font-family: FontAwesome;
color: #324b4e;
}
/*搜索框8*/
.bar8 {background: #B46381;}
.bar8 form {
height: 42px;
}
.bar8 input {
width: 0;
padding: 0 42px 0 15px;
border-bottom: 2px solid transparent;
background: transparent;
transition: .3s linear;
position: absolute;
top: 0;
right: 0;
z-index: 2;
}
.bar8 input:focus {
width: 300px;
z-index: 1;
border-bottom: 2px solid #F9F0DA;
}
.bar8 button {
background: #683B4D;
top: 0;
right: 0;
}
.bar8 button:before {
content: "\f002";
font-family: FontAwesome;
font-size: 16px;
color: #F9F0DA;
}
</style>
</head>
<body>
<div id="container">
<div class="search bar1">
<form>
<input type="text" placeholder="請輸入您要搜索的內容...">
<button type="submit"></button>
</form>
</div>
<div class="search bar2">
<form>
<input type="text" placeholder="請輸入您要搜索的內容...">
<button type="submit"></button>
</form>
</div>
<div class="search bar3">
<form>
<input type="text" placeholder="請輸入您要搜索的內容...">
<button type="submit"></button>
</form>
</div>
<div class="search bar4">
<form>
<input type="text" placeholder="請輸入您要搜索的內容...">
<button type="submit"></button>
</form>
</div>
<div class="search bar5">
<form>
<input type="text" placeholder="請輸入您要搜索的內容...">
<button type="submit"></button>
</form>
</div>
<div class="search bar6">
<form>
<input type="text" placeholder="請輸入您要搜索的內容...">
<button type="submit"></button>
</form>
</div>
<div class="search bar7">
<form>
<input type="text" placeholder="請輸入您要搜索的內容...">
<button type="submit"></button>
</form>
</div>
<div class="search bar8">
<form>
<input type="text" placeholder="請輸入您要搜索的內容...">
<button type="submit"></button>
</form>
</div>
</div>
</body>
</html>
```
- 前端開發概要
- Vue
- Vue.js
- Vue的模板
- Vue的屬性綁定和雙向數據綁定
- Vue的計算屬性和偵聽器
- v-show和v-if
- Vue簡單to do list
- Vue簡單to do list組件拆分
- Vue簡單to do list組件和實例
- Vue簡單to do list的刪除功能
- Vue的點擊事件,側重操作數據
- vue中定時器設置和關閉頁面時關閉定時器
- axios
- Vue Element-ui
- HTML轉Vue
- Vue3
- Vue開發簡易權限認證
- demo
- Vue常用命令
- Vue項目1
- 前端面試
- 算法題
- Vue框架原理
- 前端基礎
- 安全
- 模擬面試一面
- JavaScript和MySQL
- JavaScript和Redis
- HTML+CSS入門到案例
- 無限級導航欄案例開發
- iframe嵌套網頁全屏顯示
- CSS定位顯示圖片不同部分
- Select option 跳轉
- 網頁顯示JavaScript
- 簡單文本編輯器
- 用純js實現一個文本編輯器
- 視頻,音頻
- frame包住目標網站
- Web重定向
- HCJ
- HTML
- CSS
- jQuery
- Bootstrap
- CSS實例
- 【CSS3】8款好看的純CSS3搜索框
- 小工具
- menu_icon
- JavaScript
- JS獲取屏幕尺寸
- JavaScript簡易錄播圖
- 預設select option的值
- HTML和CSS基礎
- APP開發
- uni-app
- nw.js
- CSS基礎
- CSS hover 菜單
- CSS Menu
- CSS Menu 2
- Bootsrtap
- 圖片展示
- 固定topbar
- JavaScript
- 當前頁select option value跳轉頁面
- JavaScript點擊一級菜單打開和關閉二級菜單
- JavaScript json無限分級導航菜單
- JavaScript獲取url
- 其他
- JS獲取復選框中當前選中的值
- JS array 遍歷
- JavaScript無刷新修改url
- localStorage
- js版的in_array的實現方法
- JavaScript修改URL參數
- JSON
- jQuery教程
- 用PHP+MySQL+jQuery+Ajax拖放排序修改數據庫
- jQuery實例
- jQuery
- jQuery實例1
- jQuery slider實例
- jQuery加載更多功能
- jQuery前后元素移動
- datatables前端搜索功能
- jQuery select value跳轉頁面
- jQuery局部刷新
- jQuery點擊自身以外關閉彈出窗
- 點擊增加class
- 點擊增加和刪除class
- 固定向右menu
- jQuery多級menu
- 用Jquery和Json實現多語言切換
- jQuery to do list
- jQuery slideToggle
- jQuery點擊顯示和隱藏CSS
- js如何獲取點擊標簽里的值
- JavaScript和JQuery獲取DIV的值
- jQuery加載公用文件
- createElement添加內容
- createElement添加內容 - 復制案例
- jQuery 遍歷案例
- HBuilder
- 案例
- Slider
- html5 video
- Ajax
- Ajax案例1: 無優化XMLHttpRequest
- Ajax案例2: json的XMLHttpRequest
- Ajax案例3: jQuery json的XMLHttpRequest
- Ajax案例4: H5 jQuery的XMLHttpRequest
- Ajax案例5:無跳轉刷新容器獲取外部內容
- Ajax搜索
- 兩種Ajax獲取數據方式
- Cookie
- 微信小程序
- 基礎的GET和POST頁面
- Node.js
- AngularJS
- AngularJS案例
- AngularJS案例1
- ReactJS
- React native
- API
- Postman API
- Web前端常用圖標
- Photoshop
- 前端cnd
- 前端工具
- 前端模板
- Export data
- 前端工程化
- 固定菜單
- 404頁面
- test
- JavaScript框架
- 瀏覽器兼容性