video放body中即可,不要放div里
你题目的解答代码如下:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title> 页面名称 </title>
<style type="text/css">
.video-bu {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: -1;
object-fit: cover;
}
</style>
</head>
<body>
<video class="video-bu" src="https://www.w3school.com.cn/example/html5/mov_bbb.mp4" controls="controls" autoplay></video><br>
</body>
</html>
如有帮助,请点击我的回答下方的【采纳该答案】按钮帮忙采纳下,谢谢!
video外层套一个div