I'm trying to vertically center a image in a :before pseudo element. I've found a few questions about it here (and other places), but unfortunately I'm unable to make it work with those tips.
I want to center the image to come between the to lines of text:
A js-fiddle:
http://jsfiddle.net/kaze72/vb5z4/1/
<div class="body">
<div class="welcomeHeader">
<h3>Welcome</h3>
<h6>Adam Testorsson</h6>
</div>
<p>other stuff</p>
</div>
Main css:
.welcomeHeader {
padding-left: 30px;
display: inline-block;
}
.welcomeHeader:before {
background-image: url('http://www.ronnebybloggen.se/pics/apml.png');
/* background-position: 0px -20px; */
display: inline-block;
content: ' ';
vertical-align: -50%;
width: 12px;
height: 12px;
margin-left: -22px;
margin-top: -3px;
}