Give both the image and the text a vertical-align: middle – the text needs to be contained in an element that is also display: inline. So markup like this:
<div>
<span><img src="https://stackoverflow.com/questions/13408394/blah.jpg" /></span>
<span>text text text</span>
</div>
div {
display: table;
}
img {
vertical-align: middle;
display: table-cell;
}
span {
vertical-align: middle;
display: table-cell;
}
should work. Here’s a jsfiddle to demonstrate (edited fiddle to show everything is vertically aligned within a container as well.)
EDIT: to get the behavior you want, I recommend using additional display properties – table for the container and table-cell for the contained elements. Fiddle link has been updated with the changes.
EDIT: the only way I could think of to get it to work was to wrap the image in another inline container, in this case a span. I’ve updated the fiddle to demonstrate.