align attribute

Type:"left", "right", "center", "justify" or "justify-all"
Inherited:no
Used By:td, All block elements
Default:justify
See:text-align vertical-align width

How to align an element with respect to it's parent. If the text-align attribute is not specified, this also controls how the text within a text-level element like h1, p or pre is aligned, in the same was as the HTML "align" attribute.

Absolutely positioned elements ignore this attribute.

Valid values are "left", "right", "center" and "justify" (the default). Justify is interpreted as "left" for non-text elements in most locales. "justify-all" is the same as justify, but the last line of the paragraph will also be justified.

When set on a td element, this sets the default alignment for it's children, not itself. This is mainly to ease migration from HTML.

This example aligns a paragraph to the right of it's parent, and also right-aligns the text inside it.

<p align="right">
A paragraph at the right of the page
</p>

This has a similar effect to the above example, except the paragraph is in a table

<table>
  <tr>
    <td align="right"
      <p align="right">a paragraph at the right of the table column</p>
    </td>
  </tr>
</table>

To avoid right-aligning the text as well, we use the TEXT-ALIGN attribute as well

<p text-align="left" align="right">
  A paragraph at the right of the page, but with left-aligned text
</p>