English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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 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 ‹/›
IEFirefoxOperaChromeSafari
Note:Only the 'left' and 'right' values of the 'align' attribute can work normally in all major browsers.
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.
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.
<input align="left|right|middle|top|bottom">
Value | Description |
---|---|
left | Align images to the left (default). |
right | Align objects to the right. |
top | Align images upward. |
middle | Align images centrally. |
bottom | Align images downward. |