【问题标题】:Text over video html视频 html 上的文本
【发布时间】:2016-12-04 14:37:11
【问题描述】:

我正在使用 Visual Studio 2015 设计网站。我可以添加一张图片作为背景,然后在上面写,但它应该与视频不同。如何在视频上添加文本框?我需要将其设置为背景吗?谢谢

【问题讨论】:

标签: html css


【解决方案1】:

您肯定在寻找更多:

<div class="container">
    <video id="video" width="770" height="882" onclick="play();">
        <source src="video/Motion.mp4" type="video/mp4" />
    </video>
    <div class="overlay">
        <p>Content above your video</p>
        <form>
            <p>Content Below Your Video</p>
            <label for="input">Form Input Label</label>
            <input id="input" name="input" value="" />
            <button type="submit">Submit</button>
        </form>
    </div>
</div>

如果你想把内容放在视频的顶部,你会使用某种定位:

.container { position:relative; }
.container video {
    position:relative;
    z-index:0;
}
.overlay {
    position:absolute;
    top:0;
    left:0;
    z-index:1;
}

link

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多