Technology Blog

Widgets

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
3
4
5
6
7
8
9
<style>
.imageMiddle {
vertical-align:middle;
}
</style>
 
<div>
<img src="pic.jpg" class="imageMiddle" />Some Text
</div>

Enjoy!

Tags:

Leave a Reply

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