Bootstrap 3.3.7
I can't get an image to appear vertical centre inside a .col-md-12
. I've tried to use solutions from:
- Twitter Bootstrap 3: How to center a block
- How to align an image dead center with bootstrap
- How to vertically align an image inside a div?
The markup is straightforward:
<footer class="footer">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<a href="#">About</a> |
<a href="#">Terms</a> |
<a href="#">Privacy</a>
<img class="pull-right hidden-xs hidden-sm" src="footer.jpg">
</div>
</div>
</div>
</footer>
The following CSS is applied to the footer:
.footer {
height: 50px;
line-height: 50px;
background: red;
font-size: 12px;
}
I've tried:
Adding
.center-block
to theimg
. This does nothing.Adding a
.frame
around the image as per How to vertically align an image inside a div? and adjusting the width/height values accordingly. This pushes the image "underneath" the footer on to a new row.
The natural image size is 265px wide and 30px high. So I assume there is enough height (50px) on the footer for this to work.
The image is appearing at the vertical top of the footer and is not in the middle:
Fiddle here: https://jsfiddle.net/0m3verv9/1/
Where am I going wrong?