【问题标题】:Setting video as div background?将视频设置为 div 背景?
【发布时间】:2014-10-19 07:12:29
【问题描述】:

我希望将服务器端视频设置为 div 的背景。我希望文本 (h1) 位于其顶部。有没有办法让视频完全填满 div 并隐藏溢出/响应? div 是 100% 的宽度和设定的高度。

提前致谢。

【问题讨论】:

  • 嗨,欢迎来到堆栈溢出。你自己尝试过吗?你尝试了什么,它是如何失败的?您能否编辑您的问题并添加您尝试过的代码(即使它不起作用)?你有这个主题的谷歌吗?如果是这样 - 你发现了什么?即...请告诉我们您至少自己为解决这个问题付出了一些努力...我们愿意帮助那些表现出研究努力的人:)

标签: html video background


【解决方案1】:
    <div class="wrapper">
        <video class="videoInsert" controls autoplay>
        <source src="demo.mp4" type="video/mp4">
        <source src="movie.ogg" type="video/ogg">Your browser does not support the video tag.
        </video>
        <div class="video">
            <h1>text here </h1>
        </div>
    </div>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-06-24
    • 1970-01-01
    • 1970-01-01
    • 2018-09-15
    • 2018-07-26
    • 2017-01-11
    • 1970-01-01
    相关资源
    最近更新 更多