1. 圓角 border-radius
單位可以為百分比或具體值(50%,5px)
1)border-radius:apx
當只有一個數值時被因,四個角的圓角均為apx
2)border-radius: apx ?bpx
當有兩個數值時著觉,上下圓角為 apx ,左右圓角為 bpx
3)border-radius: apx? bpx cpx
當有三個數值時,上圓角為 apx ,下圓角為 bpx风罩,左右圓角為 cpx
4)border-radius: apx? bpx cpx dpx
當有四個數值時岁忘,圓角分別對應上,右深员,下数苫,左
2. 陰影 box-shadow
box-shadow: 10px 10px 10px #000;
box-shadow: x軸方向 ?y軸方向 ?blur(模糊程度) ?陰影顏色;
3. 漸變 linear-gradient
注:在background上使用,瀏覽器內核不同會有不同前綴
eg:background:-webkit-linear-gradient(-45deg,red,green);
background:-moz-linear-gradient(-45deg,red,green);
background:-o-linear-gradient(-45deg,red,green);
background:-ms-linear-gradient(-45deg,red,green);
基礎版:background:linear-gradient(方向,顏色1,顏色2)
跳變:background:linear-gradient(方向,顏色1 apx , 顏色1 bpx , 顏色2 ?bpx)
徑向漸變:-webkit-radial-gradient(left top,cirle,red? 50px,blue 50px)
重復線性漸變:-webkit-repeating-linear-gradient
4. 倒影 box-reflect
-webkit-box-reflect : 位置? 距離? 漸變
-webkit-box-reflect: below 0px -webkit-linear-gradient(rgba(0,0,0,0),rgba(0,0,0,1)
below:倒影在下面
above:倒影在上面
5. 蒙版(遮罩)-webkit-mask
eg:-webkit-mask:url("2.png") no-repeat;
1)位置
-webkit-mask-position: 100px 0 ;
6. 背景是從哪里開切的:background-clip
1)background-clip: content-box
2)background-clip: border-box;
3)background-clip:padding-box;
4)-webkit-background-clip:text; (拋光,保留文字輪廓)
7. 背景大小
background-size:50% 50%; (或者用 ?px)
contain:圖片完整情況下最適應(圖片完整情況下最大)
cover:布滿(可能 部分圖片不完整顯示)
8. 多背景 ?:
url("logo.png") no-repeat , url("logo1.gif") top right no-repeat
9.濾鏡 -webkit-filter: blur(5px);
10.文字對齊方向
unicode-bidi: bidi-override;
direction: rtl;/ltr
11.單行省略
width:200px(一定要給寬度)
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;