align (HTML attribute)

Spec
Depr. Version
Yes HTML 4
Browser support (more…)
IE5.5+ FF1+ SA1.3+ OP10 CH2+
Partial Partial Partial None Partial

Syntax

align=" { bottom | left | right | top } "

Description

The align attribute is intended to enable finer positioning of the text in relation to the fieldset’s boxed outline. In practice, though, you won’t find much use for this attribute, as it’s deprecated and poorly supported. Aside from the default position (top, left), few of the tested browsers paid any attention to any of the other values, aside from the "right" alignment, as Figure 1 shows.

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

Example

The align attribute for this group of controls is 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>

Value

This attribute accepts as its values "bottom", "left", "right", and "top". The browser default is "left".

Compatibility

Internet Explorer Firefox Safari Opera Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0
Partial Partial Partial Partial Partial Partial Partial Partial Partial Partial Partial None None None Partial

This attribute is poorly supported and highly presentational. CSS should be used to control appearance instead.

User-contributed notes

There are no comments yet.

Related Products