看别人的网页超级酷,也学着搞了下动态背景,<video>标签
-
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>动态背景实现展示页面</title>
<link rel="stylesheet" href="../css/style.css" />
</head>
<body id="bo">
<div class="main">
<a href="javascript:void(0)" class="btn_login" id="btn_showlogin" οnclick="Hide_miniLogin()" >登录框</a>
<div>
<video autoplay="autoplay" loop="loop" muted="muted" class="bgvideo" >
<source src="../video/bgVideo.mp4" type="video/mp4" />
</video>
</div>
</div>
</body>
</html>
-
CSS
*{
margin: 0px;
padding: 0px;
}
video {
position: fixed;
right:0px;
bottom:0px;
min-width: 100%;
min-height: 100%;
height: auto;
width: auto;
z-index: -1;
}
source{
position: fixed;
min-width: 100%;
min-height: 100%;
height: auto;
width: auto;
}