3

I'm having trouble aligning an image with text. I want my image on the left, and the text inline on the right, centered vertically to the image.

<div class="container">
    <span class="icon">
        <img ... />
    </span>
    <span>555-1212</span>
</div>

Right now, the text hugs the top of the container. How can I center it vertically to the middle of the container?

Stephan Muller
  • 25,898
  • 16
  • 83
  • 124
vintorg
  • 207
  • 4
  • 17

1 Answers1

4
.container span {
    display: inline-block;
    vertical-align: middle;
}

This should do it. jsFiddle

Stephan Muller
  • 25,898
  • 16
  • 83
  • 124