css的linear-gradient

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style type="text/css">
          *{
            margin: 0;
            padding: 0;
        }
        div{
            width: 300px;
            height: 200px;
            border: 1px solid #000;
            box-sizing: border-box;
            margin: 200px auto;
             /*默认情况下会从上至下的渐变*/
            /* background: linear-gradient(red,green);*/

             /*background: linear-gradient(to top,red,green);*/
            /* background:linear-gradient(to top right,red,green);*/
             background: linear-gradient(45deg,red, green);
         }
    </style>
</head>
<body>
<div></div>
</body>
</html>
©️2020 CSDN 皮肤主题: 数字20 设计师:CSDN官方博客 返回首页