English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML tag大全

HTML: <input> align attribute

The input align attribute is only used with <input type ="image">, which specifies the alignment of the image input based on the surrounding elements.

 HTML <input> tag

Online Example

HTML form with an image as the submit button. The submit button is aligned to the left:

<!DOCTYPE html>
<html>
<head>
<title>HTML:<input> align attribute - 基础教程网(oldtoolbag.com)</title>
<body>
<form action="action_page.php">
  First name: <input type="text" name="fname"><br>
  <input type="image" src="submit.gif" alt="Submit" align="left" width="48" height="48">
</form>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Note:Only the 'left' and 'right' values of the 'align' attribute can work normally in all major browsers.

Definition and Usage

HTML5 The align attribute of <input> is not supported. Please use CSS instead.

In HTML 4.01 In the <input> tag, the align attribute is deprecated.

The align attribute can only be used with <input type="image">, it specifies the alignment of the image input relative to other elements around it.

Compatibility Comments

In HTML 4.01 In the <input> tag, the align attribute is deprecated. Please use CSS instead.

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

CSS Example: Align Input Images

In our CSS tutorial, you can find more about float propertydetails.

Syntax

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

Attribute Value

ValueDescription
leftAlign images to the left (default).
rightAlign objects to the right.
topAlign images upward.
middleAlign images centrally.
bottomAlign images downward.
 HTML <input> tag