<div class="e1">接受一个方向参数,可以是关键字,to left/right/top/bottom,to哪里,渐变的方向(最后一个颜色值)就到哪里</div>
<div class="e2"></div>
<div class="e3">也可以接受一个度数参数,这样就做成了垂直的条纹</div>
div {
width:20em;
height:15em;
margin-bottom: 20px;
background-image:linear-gradient( yellow, blue);
}
.e2 {
background-image: linear-gradient(to left, yellow, blue);
}
.e3 {
background-image: linear-gradient(90deg, pink 50%, yellow 50%);
background-size:20px 100%;
}