您好,欢迎来到二三娱乐。
搜索
您的当前位置:首页html5的video全屏作为背景的方法

html5的video全屏作为背景的方法

来源:二三娱乐

直接用css来实现代码如下:

  <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%);*/  
        }  
        source{  
            min-width: 100%;  
            min-height: 100%;  
            height: auto;  
            width: auto;  
        }  
    </style>  
</head>  
<body>  
//资源格式自己进行添加  
 <video autoplay="autoplay" loop="loop">  
    <source  src="video/ting.mp4" type="video/mp4" >;  
</video>  

Copyright © 2019- yule263.com 版权所有 湘ICP备2023023988号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务