[toc]
## 搜索欄
### 1. 簡書類
>實現效果

>html代碼
```
<div class="container">
<form action="" class="parent">
<input type="text" class="search" placeholder="搜索">
<input type="button" name="" id="" class="btn">
</form>
</div>
```
>css代碼
```
* {
margin: 0;
padding: 0;
}
.container {
height: 70px;
width: 800px;
margin: 100px auto 0 auto;
}
.parent {
position: relative;
}
.search {
width: 300px;
height: 40px;
border-radius: 18px;
outline: none;
border: 1px solid #ccc;
padding-left: 20px;
position: absolute;
}
.btn {
height: 35px;
width: 35px;
position: absolute;
background: url("images/topbar.png") no-repeat -2px -99px;
top: 6px;
left: 285px;
border: none;
outline: none;
cursor: pointer;
}
```
### 2. 百度類
>實現效果

>html代碼
```
<div class="container">
<form action="" class="parent">
<input type="text">
<input type="button" value="百度一下">
</form>
</div>
```
>css代碼
**重點:
1.當input框foucus時,border顏色改變,而不是保留outline
2.button按鈕默認box-sizing: border-box**
```
.container {
width: 500px;
height: 40px;
margin: 100px auto 0 auto;
}
.parent {
position: relative;
}
.parent>input:first-of-type {
width: 300px;
height: 40px; //輸入框高度設置為40px, border占據2px,總高度為42px
border: 1px solid #ccc;
outline: none;
position: absolute;
}
.parent>input:first-of-type:focus {
border: 1px solid #317ef3;
padding-left: 10px;
}
.parent>input:last-of-type {
width: 100px;
height: 42px; //button按鈕border并不占據外圍大小,設置高度42px
position: absolute;
left: 300px;
background: #317ef3;
border: 1px solid #317ef3;
color: #fff;
font-size: 16px;
outline: none;
}
```
- 空白目錄
- css實用樣式
- css--下拉欄的幾種設計
- css--圖片陰影以及浮起的效果
- css--圖片翻轉二:自動翻轉
- css--圖片翻轉一:滑過翻轉
- css--三種loading特效
- css--圖片遮罩效果實現
- css--又是三種loading特效
- css--帶三角形的圖形實現
- js demo
- 原生demo
- 1. 原生js實現輪播圖
- 2. 倒計時按鈕
- 3. 動態添加表格
- 4. checkbox全選反選
- 5. 小米登錄方式切換
- 6. 點擊事件
- 7. 個人網頁導航條(二)點擊滾動
- 8. 瀑布流實現!
- 9. 個人網頁導航條(一)滑動固定
- 10. 定時器實現淡入淡出效果
- 11. 輪播圖setTimeout版
- jQuery demo
- 1. 輪播圖實現!
- 2. 成都小風車導航特效
- html組件
- html--導航欄(家居醫生)
- html--登錄頁面(小米登錄)
- html--響應式導航條(木兮地板)
- html--搜索欄
- Vue demo
- 1. mvvm實現動態添加表格
- 2. 豆瓣TOP250渲染
- 3. 制作一段跑馬燈文字
- 3.1. vue 單行文字自動跑馬燈效果
- 4. 利用豆瓣接口搜索書籍
- 5. 制作簡易計算器
- 6. 創建一個點贊組件
- 7. 列表添加刪除動畫
- 8. isShow手風琴原理
- 9. tab欄切換