This is a legacy document, and retained on the site in order to avoid link rot. The content is likely no longer (a) accurate, (b) representative of the views and philosophies of current site management, or (c) up to date.

ALIGN Examples

FLOAT

This shows use of the <ALIGN="left">

The CSS way: Float (left | right | none)

The CSS "float" property applies to all elements, and is not inherited. It is especially useful for inline IMG elements, which are treated as block elements when the float property is applied to them.

In Netscape4x, float is not properly implemented, so the following examples may not render correctly for Netscape users.

Floated left…

With float none… stays inline…

And float right wafts the image to the right.

TEXT-ALIGN

The CSS way: text-align (left | right | center | justify)

The CSS "text-align" property applies to block level elements, and is inherited. This example markup shows use of the <…ALIGN> attribute, applied to various HTML elements.

<CAPTION ALIGN="left">
<TABLE ALIGN="center">
<H1 ALIGN="right">

The CSS equivalent might be to include a ruleset for alignment in the external CSS, if the element will be re-used, or if the style is expected to be site-wide. Alternatively, the style could be embedded in the <HEAD>… </HEAD> section of a specific document, or inline, as in the example below.

 <H1 STYLE="text-align: center">Centered Header</H1>

Centered Header

The elements which may be aligned include:

The CSS "float" property applies to all elements, and is not inherited. It is especially useful for inline IMG elements, which are treated as block elements when the float property is applied to them.

Sue Sims