如何通过视频标签制作背景?

问题描述 投票:-1回答:2

我尝试用不透明度为0.6的视频标签制作背景:

HTML:

<body>
   <video></video>
</body>

CSS:

body {
   background: #000;
opacity: 0.6;
position: relative
}
html css html5
2个回答
1
投票

check out this fiddle link

    .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;}

1
投票

试试这个

body {}
video {
  position: relative;}
video:after {
  content: '';
  opacity: 0.6;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}
© www.soinside.com 2019 - 2024. All rights reserved.