Skip to content

Instantly share code, notes, and snippets.

@lordhasyim
Forked from petehouston/markup
Created July 13, 2017 11:05
Show Gist options
  • Save lordhasyim/1c4b5556d3a9af2505d48e281aabd9fb to your computer and use it in GitHub Desktop.
Save lordhasyim/1c4b5556d3a9af2505d48e281aabd9fb to your computer and use it in GitHub Desktop.
[Bootstrap] Text overlay center inside the image
<div class="row" id="box-search">
<div class="thumbnail text-center">
<img src="img/cafe.jpg" alt="" class="img-responsive">
<div class="caption">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab, quisquam?</p>
</div>
</div>
</div>
.thumbnail {
position: relative;
}
.caption {
position: absolute;
top: 45%;
left: 0;
width: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment