I am trying to show a horizontal top bar with logo image in the middle of it. Image is on the left of the page and vertically in the center. How would I get image at center of the topbar?
Here is my code:
<div class='topbar'>
<img src="../../img/headerlogo.png" class="topbarlogo"/>
</div>
CSS:
div.topbar {
height: 80px;
width: 100%;
background-color: #000000;
margin-top: 0px;
}
.topbarlogo {
display: block;
position: absolute;
}
Get rid of the rules for
.topbarlogoand simply set thetext-align:centerrule for your div.jsFiddle example