Quackit

This is the print version of http://www.quackit.com/css/properties/css_text-align.cfm


CSS text-align (Print Version)

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


© Copyright 2000 - 2010 Quackit.com