標籤:
1.background-origin:設定背景圖片的原始起始位置,前提是no-repeat。
<style> .bg { background:url("圖片路徑") no-repeat; background-origin:content-box/border-box/padding-box;}</style><body> <div class="bg"></div></body>
2.background-clip:設定背景圖片向外裁剪的地區。
<style> .bg { background:url("圖片路徑") no-repeat; background-clip:border-box/content-box/padding-box/text}</style><body> <div class="bg"></div></body>
3.background-size:背景的尺寸。
<style> .bg { background:url("圖片路徑") no-repeat; background-size:20px 40px /20% 40%/cover}</style><body> <div class="bg"></div></body>
4.background:背景。
<style> .bg { background: #ccc url("圖片路徑") no-repeat 50% 30px;}</style><body> <div class="bg"></div></body>
5.多重背景,用逗號隔開每組background的縮寫,如果有size值要緊跟position屬性並且用/隔開,大小不同的背景要注意順序。
<style> .bg { background:#ccc url("圖片路徑1") no-repeat center right/50px 20px, url("圖片路徑2") no-repeat center left/20px 50px}</style><body> <div class="bg"></div></body>
6.list-style-type:disc/circle/square/none。
<style> ul { list-style-type:none;}</style><body> <ul> <li>1</li> <li>2</li> <li>3</li> </ul></body>
7.list-style-image:用圖片來定義列表的每一項的頭部圖片。
<style> ul { list-style-image:url("圖片路徑");}</style><body> <ul> <li>1</li> <li>2</li> <li>3</li> </ul></body>
8.transform:改變元素的大小、透明度、旋轉角度、扭曲度。
<style> .bg { background:#ccc; width:100px; height:100px; transform:translate(水平平移參數 垂直平移參數)/ transform-origin:left/right/center/bottom/top(中心點位置); transformX(水平平移參數); translateY(垂直平移參數); rotate(旋轉角度); scale(水平縮放倍數 垂直縮放倍數); skew(扭曲角度); translate3d(X,Y,Z);}</style><body> <div class="bg"></div></body>
9.transition(過渡):步驟:a.聲明樣式初始狀態 b.聲明過渡屬性最終樣式 c.添加過渡函數,和一些樣式。
<style> .bg { width:200px; heigth:200px color:red; border-radius:10px transition:all 3s ease-in 0.1s; } .bg:hover { width:100px; height:100px color:blue; border-radius:50%;}</style><body> <div class="bg">嘻嘻</div></body>
10.transition:property/duration/timing-function/delay。屬性值(可以設定為all)/ 過渡時間 / 過渡函數(ease-in/ease-out/..)/ 延遲時間。
CSS筆記五....