Skip to: content, navigation

by Ian Lloyd

align (HTML attribute)

Browser support full matrix
IE5.5+ FF1+ Saf3 Op9.5
Partial Partial None None
Spec
Depr. Version
Yes HTML 4
align="
{ bottom | left | right | top }
"

Example

The align for this group of controls set to "right":

<form>
<fieldset>
 <legend accesskey="1" align="right">Friendship</legend>
 <input type="radio" name="radFriendship" value="Not_Applicable"
 id="radFriendNot_Applicable" />
 <label for="radFriendNot_Applicable">Not_Applicable</label>
 <input type="radio" name="radFriendship" value="acquaintance"
 id="radFriendaquaintence" />
 <label for="radFriendaquaintence">acquaintance</label>
 <input type="radio" name="radFriendship" value="friend"
 id="radFriendfriend" />
 <label for="radFriendfriend">friend</label>
</fieldset>
</form>

Description

The align attribute is supposed to enable finer positioning of the text in relation to the fieldset’s boxed outline. In practice, though, you will not find much use for this attribute as it is deprecated and poorly supported. Aside from the default position (top, left), few browsers tested paid any attention to any of the other values, aside from the "right" alignment, as shown in #align/fig-legend-right-align.

Figure 1. A right-aligned legend element A right-aligned legend element

Value

"bottom", "left", "right" and "top" only (browser default is "left").

Compatibility

IE5.5Partial
6.0Partial
7.0Partial
Firefox1.0Partial
1.5Partial
2.0Partial
Safari1.3Partial
2.0Partial
3.0None
Opera9.2None
9.5None

This attribute is poorly supported and is also highly presentational in nature. CSS should be used instead for affecting appearance.

User-contributed notes

There are no comments yet.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters