Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML input align attribute

HTML The align attribute

HTML input Tag Reference HTML tag

Example

An HTML form with an image submit button, aligned to the right:

  First name:

 

  width="48" height="48">

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

**Note:** Only the "left" and "right" values of the align attribute work in all major browsers.


Definition and Usage

HTML5 does not support the align attribute. Please use CSS instead.

In HTML 4.01, The align attribute is deprecated.

The align attribute can only be used with the element; it specifies the alignment of the image input relative to other surrounding elements.


Compatibility notes

In HTML 4.01, The align attribute is deprecated. Please use CSS instead.

CSS syntax:

CSS example: aligning an input image

In our CSS tutorial, you can find more details about The float attributedetails.


Syntax

Attribute values

Value Description
left Align the image to the left (default).
right Align the object to the right.
top Align the image to the top.
middle Align the image to the center.
bottom Align the image to the bottom.

HTML input Tag Reference HTML tag