直接上效果:
核心代码如下:
.map-interview {
background-image:-webkit-linear-gradient(
to right,
rgba(0,0,0,0) 0%,
rgba(0,0,0,0.4) 5%,
rgba(0,0,0,0.6) 10%,
rgba(0,0,0,0.6) 90%,
rgba(0,0,0,0.4) 95%,
rgba(0,0,0,0) 100%);
background-image: linear-gradient(
to right,
rgba(0,0,0,0) 0%,
rgba(0,0,0,0.4) 5%,
rgba(0,0,0,0.6) 10%,
rgba(0,0,0,0.6) 90%,
rgba(0,0,0,0.4) 95%,
rgba(0,0,0,0) 100%);
height: 220px;
left: 50%;
margin-left: -350px;
margin-top: -110px;
padding: 10px 0px 10px 30px;
position: absolute;
top: 30%;
width: 700px;
border: 1px solid rgba(0, 0, 0, 0.1);
}Best Wishes For You!
本文介绍了一种使用CSS线性渐变实现特殊背景效果的方法。通过调整透明度和颜色,创建了一个从透明到半透明再到完全不透明的过渡效果,并应用于一个具有特定尺寸和位置属性的元素中。
537

被折叠的 条评论
为什么被折叠?



