MoonPoint Support Logo


Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals

Advanced Search
Sun Mon Tue Wed Thu Fri Sat

Wed, Oct 02, 2013 10:02 pm

Vertically aligning text to an image

To vertically align text with the middle of an image in HTML code, you can add a style parameter with a vertical-align property to the img tag, e.g. style="vertical-align: middle;" to align the text with the middle of the image. You can use "top" or "bottom", instead, if you wished to have the text appear at the side of the image, but aligned with the top or bottom of the image.

<img src="Schloss-Moyland-2013-02.jpg" alt="Moyland Castle, side view" width="500" height="691" style="padding:10px; vertical-align: middle;"> <a href=""> Moyland Castle</a>, side view.

E.g., the above code would produce the following result:

Castle, side view Moyland Castle, side view.

Note: the above image is available at Wikimedia Commons here. It was a featured picture for October 2, 2013. The image was provided by Tuxyso and is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license, so anyone is free to use it or redistribute it.

[/network/web/html/css] permanent link

Once You Know, You Newegg AliExpress by

Shop Amazon Local - Subscribe to Deals in Your Neighborhood

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo