Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在对象顶部覆盖文本_Html_Css_Twitter Bootstrap - Fatal编程技术网

Html 在对象顶部覆盖文本

Html 在对象顶部覆盖文本,html,css,twitter-bootstrap,Html,Css,Twitter Bootstrap,我的网站上有一个youtube视频。我想知道是否有任何方法可以在视频的顶部布置文本,给它一个特定的标题 在视频的左侧,我该怎么做呢?我也在使用引导程序。您可以使用z索引或位置来完成此操作 <div class="container"> <iframe width="560" height="315" src="//www.youtube.com/embed/YXVoqJEwqoQ" frameborder="0" allowfullscreen></iframe&

我的网站上有一个youtube视频。我想知道是否有任何方法可以在视频的顶部布置文本,给它一个特定的标题


在视频的左侧,我该怎么做呢?我也在使用引导程序。

您可以使用z索引或位置来完成此操作

<div class="container">

<iframe width="560" height="315" src="//www.youtube.com/embed/YXVoqJEwqoQ" frameborder="0" allowfullscreen></iframe>
    <div class="my-text"> This is my text</div>
    </div>

body {
    background: #efefea
}

.container {
    width: 600px; 
    margin: 0 auto; 
    padding: 10px;
    position: relative; 
}

iframe {
    marign: 0 auto; 
}

.my-text {
    position: absolute;
    color: #fff;
    padding: 10px 0px;
    text-align: center; 
    font-size: 50px; 
    background: rgba(0,0,0, 0.5);
    top: 20px;
    left: 0; 
    right: 0;
}