1. Home
  2. Computing & Technology
  3. Web Design / HTML

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://z.about.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://z.about.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://z.about.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://z.about.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://z.about.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://z.about.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://z.about.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://z.about.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.

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. About.com Web Design A to Z
  5. Examples
  6. vertical-align Examples

©2008 About.com, a part of The New York Times Company.

All rights reserved.