Last Updated : 12 Jul, 2025
The HTML <input> align attribute is used with <input type=” image”> to set the horizontal alignment of the image. It is not supported by HTML 5.
Note: Since <input type=” image”> is not supported by HTML5 you can use CSS there instead of this attribute. The syntax for CSS <input type=”image” style=”float: right”>.
Syntax:<input align="left|right|middle|top|bottom">Attribute Values:
left
It sets the alignment of the image to the left. it is a default value.
right
It sets the alignment of the image to the right.
middle
It sets the alignment of the image to the middle.
top
It sets the alignment of image to the top.
bottom
It sets the alignment of image to the bottom.
Example1:
html
<!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=
"https://media.geeksforgeeks.org/wp-content/uploads/20190506164011/logo3.png"
alt="GeeksforGeeks logo"
align="right">
</body>
</html>
Output:
Example 2:
html
<!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>
<input type="image" src=
"https://media.geeksforgeeks.org/wp-content/uploads/20190506164011/logo3.png"
alt="GeeksforGeeks" align="right">
</div>
</body>
</html>
Output:
Supported Browsers:HTML <input> align Attribute
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4