【CSS3】漸層

來源:互聯網
上載者:User

標籤:gradient   border   logs   gre   nbsp   sid   color   htm   css   

 1 <!DOCTYPE html> 2 <html> 3 <head> 4     <meta charset="utf-8"> 5     <title></title> 6     <link rel="stylesheet" type="text/css" href="style.css"> 7 </head> 8 <body> 9     <div id="div1"></div>10     <div id="div2"></div>11 </body>12 </html>
 1 div{ 2     width: 300px; 3     height: 200px; 4     border:solid; 5 } 6 #div1{ 7     /*background-image: linear-gradient(red,blue);*//*預設從上到下*/ 8     /*background-image: linear-gradient(0deg,red,blue);*//*0deg從下到上*/ 9     /*background-image: linear-gradient(to right,red,blue);*/10     /*background-image: linear-gradient(to left,red,blue);*/11     /*background-image: linear-gradient(to right bottom,red,blue);*/12     /*background-image: linear-gradient(to right,red,green,blue);*/13     /*background-image: linear-gradient(to right top,red 25%,green 50%,orange 75%,blue 100%);*/14     /*background-image: linear-gradient(to right top,red 0px,green 100px,orange 200px,blue 300px);*/15     background-image: repeating-linear-gradient(to right top,red 0px,green 10px,orange 20px,blue 30px);/*30px之後開始重複漸層設定*/16 }17 #div2{18     /*background-image: radial-gradient(red,blue);*//*預設從裡到外*/19     /*background-image: radial-gradient(circle,red,green,blue);*//*預設ellipse橢圓,可設circle圓*/20     /*background-image: radial-gradient(circle at right,red,green,blue);*/21     /*background-image: radial-gradient(circle at left bottom,red,green,blue);*/22     /*background-image: radial-gradient(circle 50px,red,green,blue);*//*50px為半徑*/23     /*background-image: radial-gradient(circle farthest-corner,red,green,blue);*//*半徑除了可以像素如50px,還可用關鍵字closest-side圓心到距離最近的邊、farthest-side圓心到距離最遠的邊、closest-corner圓心到距離最近的角、farthest-corner圓心到距離最遠的角*/24     background-image: repeating-radial-gradient(circle closest-side,red,green,blue);25 }

 

【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.