First things first, take note of the two elements in your code that have a display: block
property applied to them - these are classes .container
, center-block
, and img-responsive
. Additionally, there is one element with a display: inline
behavior (the default behavior for the <a>
tag). To properly center nested elements, you should change the display: inline
to display: inline-block
. An easy fix is to include the Bootstrap class .text-center
to the parent element (div.container
in this case) rather than using the unnecessary .center-block
class.
<div class="container text-center">
<a class="inline_block" href="/Home">
<img class="img-responsive" src="/home_logo.png" alt="Home">
</a>
</div>
.inline_block {
display: inline-block;
}
Check out this JSFiddle example for reference.