背景的添加和透明化

body:before {
    background: url(https://tva1.sinaimg.cn/large/0072Vf1pgy1foxkiqu05cj31hc0u0duy.jpg) center/cover no-repeat;
    content: '';
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.79;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    -webkit-filter: grayscale(40%);
    -moz-filter: grayscale(40%);
    -ms-filter: grayscale(40%);
    -o-filter: grayscale(40%);
    filter: grayscale(40%);
    filter: gray;
}

插入以上代码至页面定制CSS代码【调节背景透明度:(opacity;n)[n取0~1]】

猜你喜欢

转载自www.cnblogs.com/projectdcy/p/12407594.html
今日推荐