How to vertically align an image inside a div
How can you align an image inside of a containing div ? Example In my example, I need to vertically center the <img> in the <div> with class ="frame ": <div class="frame" style="height: 25px;"> <img src="http://jsfiddle.net/img/logo.png" /> </div> .frame 's height is fixed and image's height is unknown. I can add new elements in .frame if that's the only solution. I'm trying to do this on Internet Explorer 7 and later, WebKit, Gecko. See the jsfiddle here . .frame { height: 25px; /* Equals maximum image height */ line-height: 25px; width: 160px; border: 1px solid red; text-align: center;