HTML | <input> align Attribute
The HTML <input> align attribute is used with <input type=”image”> to set the horizontal alignment of image. It is not supported by HTML 5.
Syntax:
<input align="left|right|middle|top|bottom">
Attribute Values:
- left: It sets the alignment of image to the left.
- right: It sets the alignment of image to the right.
- middle: It sets the alignment of image to the middle.
- top: It sets the alignment of image to the top.
- bottom: It sets the alignment of image to the bottom.
Example 1:
<!DOCTYPE html> <html> <head> <title> HTML input align Attribute </title> </head> <body> <h1 style="color:green;">GeeksforGeeks</h1> <h3>HTML input align Attribute</h3> <input type="image" src= alt="GeeksforGeeks logo" align="right"> </body> </html> |
Output:

Example 2:
<!DOCTYPE html> <html> <head> <title> HTML input align Attribute </title> </head> <body> <center> <h1 style="color:green;">GeeksforGeeks</h1> <h3>HTML input align Attribute</h3> </center> <div> Email_id: <!--Here type="text" align will not work--> <input type="text" alt="mail_id" align="right"> <input type="image" src= alt="GeeksforGeeks" align="right"> </div> </body> </html> |
Output:

Note: Since <input type=”image”> is not supported by the HTML5 so you can use CSS there instead of this attribute. Syntax for CSS <input type=”image” style=”float:right”>.
Supported Browsers:
- Google Chrome
- Internet Explorer
- Firefox
- Safari
- Opera
Recommended Posts:
- HTML | <col> align Attribute
- HTML | <tr> align Attribute
- HTML | <img> align Attribute
- HTML | <div> align Attribute
- HTML | <td> align Attribute
- HTML | <p> align Attribute
- HTML | <hr> align Attribute
- HTML | <th> align Attribute
- HTML | <tbody> align Attribute
- HTML | <caption> align Attribute
- HTML | <legend> align Attribute
- HTML | <tfoot> align Attribute
- HTML | <object> align Attribute
- HTML | <colgroup> align Attribute
- HTML <table> align Attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



