1. Computing & Technology

vertical-align Examples

Examples of How the vertical-align CSS Property Works

Return to the vertical-align information.

Standard Vertical Alignment of Text By an Image

image The quick brown fox jumped over the lazy sleeping dog.

<p>
<img src="http://0.tqn.com/d/webdesign/1/0/g/K/1/verticalalignimage.gif" alt="image" />
The quick brown fox jumped over the lazy sleeping dog.
</p>

Return to the vertical-align information.

Subscript Vertical Alignment of Text

image The quick brown fox jumped over the lazy sleeping dog.

<p>
<img src="http://0.tqn.com/d/webdesign/1/0/g/K/1/verticalalignimage.gif" alt="image" />
<span style="vertical-align:sub;">The quick brown fox</span> jumped over the lazy sleeping dog.
</p>

Return to the vertical-align information.

Superscript Vertical Alignment of Text

image The quick brown fox jumped over the lazy sleeping dog.

<p>
<img src="http://0.tqn.com/d/webdesign/1/0/g/K/1/verticalalignimage.gif" alt="image" />
<span style="vertical-align:super;">The quick brown fox</span> jumped over the lazy sleeping dog.
</p>

Return to the vertical-align information.

Top Alignment of Text Beside a Taller Image

image The quick brown fox jumped over the lazy sleeping dog.

<p>
<img src="http://0.tqn.com/d/webdesign/1/0/g/K/1/verticalalignimage.gif" alt="image" />
<span style="vertical-align:top;">The quick brown fox</span> jumped over the lazy sleeping dog.
</p>

Return to the vertical-align information.

Text-Top Alignment of Different Sized Fonts

image The quick brown fox jumped over the lazy sleeping dog.

<p style="font-size:xx-large;">
<img src="http://0.tqn.com/d/webdesign/1/0/g/K/1/verticalalignimage.gif" alt="image" />
<span style="vertical-align:text-top; font-size:medium;">The quick brown fox</span> jumped over the lazy sleeping dog.
</p>

Return to the vertical-align information.

Align an Image in the Middle of the Text Baseline

image The quick brown fox jumped over the lazy sleeping dog.

<p>
<img src="http://0.tqn.com/d/webdesign/1/0/g/K/1/verticalalignimage.gif" alt="image" style="vertical-align:middle;" />
The quick brown fox jumped over the lazy sleeping dog.
</p>

Return to the vertical-align information.

Align Bottom of Text (Not Including Descenders) With Baseline of Largest Font

image The quick brown fox jumped over the lazy sleeping dog.

<p style="font-size:xx-large;">
<img src="http://0.tqn.com/d/webdesign/1/0/g/K/1/verticalalignimage.gif" alt="image" />
<span style="vertical-align:bottom; font-size:medium;">The quick brown fox</span> jumped over the lazy sleeping dog.
</p>

Return to the vertical-align information.

Align Bottom of Text (Including Descenders) With Baseline of Largest Font

image The quick brown fox jumped over the lazy sleeping dog.

<p style="font-size:xx-large;">
<img src="http://0.tqn.com/d/webdesign/1/0/g/K/1/verticalalignimage.gif" alt="image" />
<span style="vertical-align:text-bottom; font-size:medium;">The quick brown fox</span> jumped over the lazy sleeping dog.
</p>

Return to the vertical-align information.

Discuss in my forum

©2012 About.com. All rights reserved.

A part of The New York Times Company.