微信扫一扫看面试题

关注面试题库

css3透明度渐变

在需要使用透明度渐变的div中添加 linear类即可

<div class="linear" style="widht:500px;height:500px"></div>
.linear {
    background: -webkit-linear-gradient( top, rgba(0, 0, 0, 0),rgba(0, 0, 0, 0.2) ); /* Safari 5.1 - 6 /
    background: -o-linear-gradient(bottom,rgba(0, 0, 0, 0),rgba(0, 0, 0, 0.2)); / Opera 11.1 - 12*/
    background: -moz-linear-gradient( bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2)); /* Firefox 3.6 - 15*/
    background: linear-gradient(to bottom,rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2)); /* 标准的语法 */
}

喜欢的可以关注哟

posted @ 2022-07-23 10:02  web前端面试小助手  阅读(107)  评论(0)    收藏  举报