align (HTML attribute)

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

Syntax

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

Description

Instead of using a button to submit form details, you may wish to use an image (see image input for more details). Just as you can align the img element in HTML, you do the same for one used as an input. However, the use of this attribute isn’t recommended; instead, use CSS to align the image. Without CSS, you have limited control over design, as Figure 1 shows, where the text wraps around the image unattractively.

Figure 1. An input of type "image", aligned left An input of type image, aligned left

Example

The align attribute for this input is set to "right":

<form>
  ⋮
  <input type="image" src="submit.jpg" alt="Submit your details"
      align="right"/>
  <p>This a load of explanatory text that we need at the end of the
      form. This a load of explanatory text that we need at the end of
      the form. This a load of explanatory text that we need at the end
      of the form. </p>
</form>

Value

Possible values for this attribute include "bottom", "left", "middle", "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 3.0 3.5 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 Partial Partial Partial Partial Partial Partial

This attribute is now deprecated, and is highly presentational in its nature. The desired visual effects can all be achieved with CSS and, as such, this attribute shouldn’t be used—it’s presented here for informational purposes only.

User-contributed notes

There are no comments yet.

Related Products