Quackit Logo

FREE Hosting!

With every domain name you register with ZappyHost, you get FREE hosting.

PLUS you get:

  • FREE Website Builder
  • FREE Blog
  • FREE Starter Web Page
  • FREE Email Account
  • & much more! (Total value $123 for FREE!)
Get your FREE hosting today! >>

CSS align

Print Version

You may be familiar with the HTML ALIGN attribute which can be used with tags such as TABLE, TD, IMG. This attribute allows you to align elements horizontally. HTML also has a VALIGN attribute for aligning elements vertically.

There isn't actually a CSS ALIGN or CSS VALIGN property. Instead, CSS has the text-align which applies to inline content of block-level elements, and vertical-align property which applies to inline level and table cells.

CSS text-align example

td { text-align: right }

The css text-align property applies to the contents of the block-level element - it doesn't need to be text. For more information on usage, see the text-align property page.

CSS vertical-align example

td { vertical-align: text-top }

Note that at the time of writing, browser support for vertical-align was limited. For more information on usage, see the vertical-align property page.

Enjoy this website?

  1. Link to this page (copy/paste into your own website or blog):
  2. Add this page to your favorite social bookmarks sites:
               
  3. Add this page to your Favorites

Oh, and thank you for supporting Quackit!