美文网首页
视频做背景

视频做背景

作者: xueyueshuai | 来源:发表于2021-09-18 13:38 被阅读0次
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        #home {
            width: 100%;
            height: 100vh;
            position: relative;
        }

        #home .overlay {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            background-color: rgba(0, 0, 0, 0.75);
            z-index: 1;
        }

        #home video {
            position: fixed;
            min-width: 100%;
            min-height: 100%;
            box-sizing: border-box;

            z-index: -100;
            /* background-size: cover; */
            transition: 1s opacity;
        }
    </style>
</head>


<body>


    <!-- HOME -->
    <section id="home" class="parallax-section">
        <div class="overlay"></div>
        <!-- Video -->
        <video autoplay loop muted>
            <source src="./s/videos/video.mp4" type="video/mp4">
            Your browser does not support the video tag.
        </video>
    </section>

    <div style="height: 300px;background-color: rgba(236, 227, 227, 0.336);"></div>

</body>

</html>

相关文章

网友评论

      本文标题:视频做背景

      本文链接:https://www.haomeiwen.com/subject/ldtnwltx.html