HTML input align property
Examples
Submit button with a picture of an HTML form, the submit button is aligned to the right:
<form action="demo_form.html">
First name: <input type="text" name="fname"><br>
<input type="image" src="submit.gif" alt="Submit" align="right"
width="48" height="48">
</form>
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"
Browser Support
Note: Only the"left" and "right" align attribute values can work in all major browsers.
Definition and Usage
HTML5 does not support the <input> align attribute. Use CSS instead.
In HTML 4.01, <input> The align attribute is deprecated .
align property works only with <input type = "image"> with the use, it provides an image input with respect to the alignment of the other surrounding elements.
Compatibility Notes
In HTML 4.01, <input> The align attribute is deprecated. Use CSS instead.
CSS Syntax: <input type = "image" style = "float: right">
CSS Example: align input image
In our CSS tutorial you can find more information about the float property detail.
grammar
<input align="left|right|middle|top|bottom">
Property Value
值 | 描述 |
---|---|
left | 左对齐图像(默认)。 |
right | 右对齐对象。 |
top | 上对齐图像。 |
middle | 居中对齐图像。 |
bottom | 下对齐图像。 |
HTML <input> tag