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
  • 27,018
  • 16
  • 85
  • 126
vintorg
  • 217
  • 4
  • 17

1 Answers1

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

This should do it. jsFiddle

Stephan Muller
  • 27,018
  • 16
  • 85
  • 126