我尝试用不透明度为0.6的视频标签制作背景:
HTML:
<body>
<video></video>
</body>
CSS:
body {
background: #000;
opacity: 0.6;
position: relative
}
.video-wrapper{width:320px;height:240px;position:relative;}
.video-overlay{background:red;opacity:0.6;position:absolute;width:100%;height:100%;top:0;left:0;}
.video-wrapper:hover .video-overlay{display:none;}
试试这个
body {}
video {
position: relative;}
video:after {
content: '';
opacity: 0.6;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}