border:10px solid hsla(0,0%,100%,.5); background: white; background-clip: padding-box;
background-clip: border-box|padding-box|content-box;
box-shadow: 0 0 0 10px red, 0 0 0 15px green, 0 2px 5px 20px white;
*:須要注意的是,上面所建立的邊框是僞邊框,並不響應鼠標事件。瀏覽器
border: 5px solid red; outline: 10px solid green;
background: url(2.jpg) no-repeat; width: 100%; height: 100%; background-position: right 10px bottom 10px;
*:只有background-image時,須要設置基礎大小,否則不會顯示,由於背景圖片不會撐開div。url
background-position默認是以padding-box爲準,經過background-origin能夠設置爲content-box。spa
background: url(2.jpg) no-repeat; background-position: calc(100% - 10px) calc(100% - 10px);
*:calc以左上角爲基準。
**:calc裏的加減運算負先後必須有空格,這是爲了向前兼容。3d
color: white; background:black; border-radius: .8em; padding: 1em; box-shadow: 0 0 0 .6em red; outline: .6em solid red;
background:linear-gradient(gray 30%,pink 70%);//漸變 background:linear-gradient(gray 30%,pink 30%);//不漸變
*:若是咱們把第二個色標的位置值設置爲 0, 那它的位置就老是會被瀏覽器調整爲前一個色標的位置值。code
background:linear-gradient(90deg,red 50%,blue 0); background-size: 50% 100%;
background:repeating-linear-gradient(60deg,#fb3 0px,#fb3 15px,#58a 15px,#58a 30px);//角度,條紋1的漸變顏色1 起點,條紋1的漸變顏色2 終點,條紋2的漸變顏色1 起點,條紋2的漸變顏色2 終點;
background:#58a; background-image: repeating-linear-gradient(30deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,.1),15px,transparent 0,transparent 30px);
background:#58a; background-image: linear-gradient(90deg,rgba(200,0,0,.5) 50%,transparent 0),linear-gradient(rgba(200,0,0,.5) 50%,transparent 0); background-size: 30px 30px;
background:#655; background:radial-gradient(tan 30%,transparent 0),radial-gradient(tan 30%,transparent 0);; background-size: 30px 30px; background-position: 0 0 ,15px 15px;
*:爲了達到效果,第二層的偏移量必須爲貼片寬度的一半。blog
padding: 1em; border: 1em solid transparent; background: linear-gradient(white,white),url(./2.jpg); background-size: cover; background-clip: padding-box,border-box; background-origin: border-box;
*:background-clip 屬性規定背景的繪製區域。事件
padding: 1em; border: 16px solid transparent; border-image: 16 repeating-linear-gradient(-45deg,red 0,red 1em,transparent 0,transparent 2em,#58a 0,#58a 3em,transparent 0,transparent 4em);