0
这是我在stackoverflow上的第一篇文章!用bootstrap重叠图片上的文字
我想重叠包含图像与Twitter引导的div上的文本。我在一个带有PSD的网站上工作,我必须制作一些文本的视差,有时半部分重叠一些图像。
但我听说z-index不适用于bootstrap,是吗?
我尝试过使用缩略图类的技巧,但它似乎并不是一个好的解决方案。我发布了我的代码,希望有人能帮助我。谢谢。
.thumbnail {
position:relative;
}
.thumbnail_legend {
background: none repeat scroll;
opacity: 1;
left:0;
position: absolute;
}
.organic{
margin-top:3%;
}
.organic img{
width: 100%;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<div class="organic container">
<div class="row">
<h2 class ="col-xs-2 col-xs-offset-2 col-sm-2 col-sm-offset-2 col-md-2 col-md-offset-2 col-lg-2 col-lg-offset-2">ORGANIC
</h2>
<div class="col-xs-7 col-sm-7 col-md-7 col-lg-7 thumbnail"><img src="elem/photo-1-idea.jpg" alt="organic infusions"/>
</div>
<p class="col-xs-4 col-xs-offset-2 col-sm-4 col-sm-offset-2 col-md-4 col-md-offset-2 col-lg-4 col-lg-offset-2 thumbnail_legend"> Nos infusions en tige offrent une nouvelle façon de consommer les plantes issues de terroirs exceptionnels.
</p>
</div>
</div>