text-align
Definition
The text-align property specifies the alignment of inline content (text and images) for block elements such as paragraphs and headings, as well as tables cells. The screen shot below shows an image center-aligned because it is contained by a heading with text-align set to center.

Below is the markup for the screen shot above.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><title>CSS Example</title><style type="text/css">h1 {text-align: center}</style></head><body><h1><img src="logo.gif" alt="Pink Flower Web Design" /></h1></body></html>
Example
h1 {text-align: center}
Characteristics
Possible values
left- Align left.
right- Align right.
center- Align center.
justify- Align left and right.
inherit- Use the same computed value as the parent element for this property.
Default value
left if text direction is ltr; right if direction is rtl
Applies to
Block-level elements, table cells (th and td) and elements with display property set to inline-block.
Inherited
Yes
See also