Quackit Logo
HTML
CSS
Scripting
Database
Hosting
Design
XML

Print Version

CSS text-align

Also see the full, alphabetical list of CSS properties


The CSS text-align property is used for aligning elements left, right, center etc.

Although the property name is "text-align", according to the CSS specification, it applies to inline content of a block element. This implies that you aren't just limited to aligning text - that the text-align property can be used to align any element within a block level element. This appears to be how most browsers interpret the property too.

Syntax: text-align: <value>
Possible Values:
  • left
  • right
  • center
  • justify
  • <string> - for example, a full stop (period). This value only works on table cells.
  • inherit
Initial Value: Depends on browser/user agent and the writing direction
Applies to: Block level elements
Inherited: Yes
Media: Visual
Example:
td { text-align: right }
Try it yourself!


Also see all CSS properties listed alphabetically


Enjoy this website?

  • Share
  • Add this page to your Favorites
  • Link to this page (copy/paste into your own website or blog):
  • Link to Quackit using one of these banner ads.
  • Help support Quackit by making a donation

Oh, and thank you for supporting Quackit!

© Copyright 2000 - 2010 Quackit.com