css的linear-gradient注意点

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>127-线性渐变</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .main{
            width: 400px;
            height: 200px;
            border: 1px solid #000;
            box-sizing: border-box;
            margin: 200px auto;
            /*
            注意点:
            至少需要传递2个颜色, 至多没有上限
            */
            
            */
            background: linear-gradient(to right, red 100px, green 100px, blue 100px);
        }
        .one, .two, .three{
            width: 100px;
            height: 100%;
            border: 1px solid #000;
            box-sizing: border-box;
            float: left;
        }
    </style>
</head>
<body>
<div class="main">
    <div class="one"></div>
    <div class="two"></div>
    <div class="three"></div>
</div>
</body>
</html>
©️2020 CSDN 皮肤主题: 数字20 设计师:CSDN官方博客 返回首页