CSS筆記五....

來源:互聯網
上載者:User

標籤:

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筆記五....

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.