This is my first post on stackoverflow!
I’m trying to overlap a text on a div that contain an image with Twitter Bootstrap. I work on a website with a PSD and I’ve got to make some parallaxes of text, that sometimes half-overlap some images.
But I heard that z-index don’t work with bootstrap, does it?
I tried with the thumbnail class trick but it does not seem to me to be a good solution. I Post my code and I hope someone can help me. Thanks.
.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>
2
Answers
so, I've done these changes and that works :
use
position:absolute
to all dom element, which you want to put above the image.