写div+css 背景透明度90 怎么写多给几种写法
- 使用rgba颜色值实现背景透明度90%:
div {
background-color: rgba(255, 255, 255, 0.9);
}
- 使用opacity属性实现背景透明度90%:
div {
background-color: white;
opacity: 0.9;
}
- 使用伪元素实现背景透明度90%:
div {
position: relative;
background-color: white;
}
div::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: white;
opacity: 0.9;
z-index: -1;
}
- 使用background属性实现背景透明度90%:
div {
background: rgba(255, 255, 255, 0.9);
}
- 使用CSS3的backdrop-filter实现背景透明度90%:
div {
background-color: white;
backdrop-filter: blur(10px) opacity(0.9);
}
原文地址: https://www.cveoy.top/t/topic/bNv9 著作权归作者所有。请勿转载和采集!