Technology Blog

Widgets

Posts Tagged ‘CSS’

Align Image Vertically with Text using CSS

Most people will try to wrap the text with a span class and try to vertically align it.

When what you really have to do is apply the class to the image instead.

For example:

  1.  
  2. <style>
  3. .imageMiddle {
  4. vertical-align:middle;
  5. }
  6. </style>
  7.  
  8. <div>
  9. <img src="pic.jpg" class="imageMiddle" />Some Text
  10. </div>
  11.  

Enjoy!

© ZADRO Solutions, Inc. All Rights Reserved. Disclaimer | Privacy Policy
RSS Facebook Digg Delicious Stumble Upon Twitter