1 父級display:flex; 子集:margin:auto;可以實現(xiàn)子集平均分配。
2 p元素里面的文字換行:white-space: inherit;
3 禁止出現(xiàn)豎向滾動條:
::-webkit-scrollbar{
width:0;
}
4 media 標(biāo)簽需要放到樣式的最末尾,防止不生效
5 線性漸變的屬性:
background:-webkit-linear-gradient( top(角度也可以),#f6f6f6,#9e9e9e)
6 控制文字間距
letter-spacing: 1px;
7自動打開郵箱
<a style="color:#17a1e8" href="mailto:bd@dding.cn">bd@dding.cn</a>
8 p元素里面的內(nèi)容兩邊對齊
text-align: justify;
9 字體設(shè)置透明度
color:rgba(255,255,255,0.5)
10 出現(xiàn)省略號
text-overflow:ellipsis;
overflow:hidden;
white-space:nowrap;
11 解決谷歌瀏覽器字體變大
-webkit-font-smoothing: antialiased;
12 用偽類清楚浮動的方法:
display: block;
content: '';
clear: both;
13 解決IE瀏覽器下圖片邊框問題
border:none
14 鼠標(biāo)選不中
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
15 背景圖片的長寬比
width:100%;
padding-top:70%
10:7
16 防止?jié)L動條滾動
body{overflow:hidden}
17 字體變得細膩
*{-webkit-font-smoothing: antialiased;}
18 表單提交
<input type="submit" value="注冊"> 自動序列化提交
<input type="button" value="注冊"> 不會提交
19 未知元素水平垂直居中
* display:flex;justify-content:centent;align-item:center
* position:absolute,top:0,right:0,left:0,bottom:0,margin:auto;
* positiom:absolute;top:50%,left:50%,transfrom:translate(-50%,-50%)
* 父元素:display:table-cell;width:300px;height:300px;text-align:center;vertical-align:middle;
子元素:display:inline-block;