慕容的工作随笔

慕容的工作随笔

记录学习和工作

【转载】利用css将视频作为背景图片

转自:https://blog.csdn.net/zhh_5/article/details/126519567

<div class="videocontainer">
    <video class="fullscreenvideo" poster="__ROOT__/Themes/tdt/Asset/images/loginbg.jpg" id="bgvid" playsinline="" autoplay="" muted="" loop="">
        <source src="视频路径" type="video/mp4">
    </video>
</div>
.fullscreenvideo {
        position: absolute;

        width: 100%;

        height:100%;

    }

    .videocontainer {

        position: fixed;

        width: 100%;

        height: 100%;

        overflow: hidden;

        z-index: -100;

    }

    .videocontainer:before {

        content: &quot;&quot;;

        position: absolute;

        width: 100%;

        height: 100%;

        display: block;

        z-index: -1;

        top: 0;

        left: 0;

    }</code></pre>

评论 (0)

还没有评论,来做第一个吧。

发表评论

提交后需管理员审核通过后显示