Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

CSS3 ไล่ระดับแนวทแยง


เส้นทแยงมุมเริ่มต้นที่ปุ่มด้านบนซ้ายและขวา คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อใช้การไล่ระดับสีในแนวทแยงใน CSS3 -

<html>
   <head>
      <style>
         #grad1 {
            height: 100px;
            background: -webkit-linear-gradient(left top, red , blue);
            background: -o-linear-gradient(bottom right, red, blue);
            background: -moz-linear-gradient(bottom right, red, blue);
            background: linear-gradient(to bottom right, red , blue);
         }
      </style>
   </head>
   <body>
      <div id = "grad1"></div>
   </body>
</html>