X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML <input> align Attribute

HTML input Tag Reference HTML <input> tag

Example

An HTML form with an image as a submit button. The submit button is aligned to the right:

<form action="demo_form.asp">
  First name: <input type="text" name="fname"><br>
  <input type="image" src="submit.gif" alt="Submit" align="right" width="48" height="48">
</form>

Try it Yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

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


Definition and Usage

The align attribute is only used with <input type="image"> and it specifies the alignment of the image input according to surrounding elements.


Compatibility Notes

The align attribute of <input> is not supported in HTML5. Use CSS instead.

CSS syntax: <input type="image" style="float:right">

CSS Example: align input image

In our CSS tutorial you can find more details about the float property.


Syntax

<input align="left|right|middle|top|bottom">

Attribute Values

Value Description
left Left-aligns the image (this is default)
right Right-aligns the image
top Top-aligns the image
middle Middle-aligns the image
bottom Bottom-aligns the image


HTML input Tag Reference HTML <input> tag

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook