css3的背景色彩坡形@線性漸層

來源:互聯網
上載者:User

標籤:

 背景色彩坡形之線性漸層

    文法形式: firefox瀏覽器      background:-moz-linear-gradient(position/deg,startColor,endColor);

         opera瀏覽器        background: -o-linear-gradient(position/deg,startColor,endColor);

         safari和chrome瀏覽器    background: -webkit-linear-gradient(position/deg,startColor,endColor);//新版本

         在ie下主要通過濾鏡實現。??

    案例:第一個參數為角度或者top、left等位置參數,但是因為top、left的變化較單一,所以一般使用角度作為參數,更利於實現多種漸層。

 1 <!DOCTYPE html> 2 <html> 3 <head> 4     <title>css3</title> 5 </head> 6 <style type="text/css"> 7     .example{ 8         width:100%; 9         height:500px;10         background: linear-gradient(45deg,red,blue);11         background: -webkit-linear-gradient(45deg,red,blue);12         background: -o-linear-gradient(45deg,red,blue);13         background: -moz-linear-gradient(45deg,red,blue);14     }15 </style>16 <body>17 <div class="example">18     11119 </div>20 </body>21 </html>

    當指定的角度時,該角度為一個由水平線與漸層線產生的的角度,逆時針方向。因此,使用0deg將產生一個左到右水平漸層,而90度將建立一個從底部到頂部的垂直漸層。

參考:http://www.w3cplus.com/content/css3-gradient

 

css3的背景色彩坡形@線性漸層

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.