html5视频作为页面背景

<!DOCTYPE HTML>
<html>
 <style type="text/css">  
        *{  
            margin: 0px;  
            padding: 0px;  
        }  
        video{  
            position: fixed;  
            right: 0px;  
            bottom: 0px;  
            min-width: 100%;  
            min-height: 100%;  
            height: auto;  
            width: auto;  
            /*加滤镜*/  
            /*-webkit-filter: grayscale(100%);*/  
            /*filter:grayscale(100%);*/  
            z-index:-11
        }  
        source{  
            min-width: 100%;  
            min-height: 100%;  
            height: auto;  
            width: auto;  
        }  
    </style>  
</head>  
<body>  
//资源格式自己进行添加  
 <video autoplay loop="loop">  
    <source src="./movie.mp4" type="video/mp4">
</video>  
<button>大家好 </button>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/seanxwq/article/details/80760895