其他分享
首页 > 其他分享> > CSS渐变

CSS渐变

作者:互联网

渐变

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>渐变背景</title>
    <style>
      .box {
        width: 300px;
        height: 200px;
        border: 2px solid orange;

        /* 
        背景颜色渐变 bgi   background-image: linear-gradient(参数1, 参数2, 参数3, ....);
        参数1:
          方位:默认的方位从上到下
            1.方位名词:to right,to right bottom
            2.角度deg:直接写度数即可,不用再加to

        参数2:颜色1;
        参数3:颜色2;.....
         */
        
        background-image: linear-gradient(45deg, red, green, blue);
      }
    </style>
  </head>

  <body>
    <div class="box"></div>
  </body>
</html>

标签:right,方位,linear,渐变,参数,image,CSS
来源: https://www.cnblogs.com/linaibo/p/15957097.html