解决CSS背景透明,内容字体不透明

做过项目的童鞋们应该都会遇到过这个问题,就是遇到给父类做了透明,子类也跟着透明,达不到我们的目的,让人很无奈的,用旧的方法会多些几个标签有点浪费标签,下面给出一个很好的解决办法:

.zmtc_navbar{
    position: fixed;
    top: 0;
    left: 0;
    width: calc(100% - 14px);
    padding: 0 7px;
    height: 35px;
    background:rgba(0,0,0,0.6) none repeat scroll !important;
    margin:0 auto;
    z-index: 99;
}

background:rgba(0,0,0,0.6) none repeat scroll !important;  这一行代码就解决了这个问题,是不是觉得很赞。

欢迎分享本文,转载请保留出处:前端ABC » 解决CSS背景透明,内容字体不透明

分享到:更多 ()

发表评论 0