项目场景:
CSS3-渐变色效果实现
解决方案:
1.(默认)上下线性渐变:
.class_name {
height: 1.333rem;
background-image: linear-gradient(#E54E55, yellow);
}
2.从左到右的线性渐变:
.class_name {
height: 1.333rem;
background-image: linear-gradient(to right, #E54E55, yellow);
}
3.从左到右的线性渐变 - 带透明度:
.class_name {
height: 1.333rem;
background-image: linear-gradient(to right, rgba(255,0,0,0), rgba(255,0,0,1));
}