An HTML form with an image as a submit button. The submit button is aligned to the right:
The align attribute is only used with <input type="image"> and it specifies the alignment of the image input according to surrounding elements.
Attribute | |||||
---|---|---|---|---|---|
align | Yes | Yes | Yes | Yes | Yes |
Note: Only the "left" and "right" values of the align attribute work properly in all major browsers.
The align attribute of <input> is not supported in HTML5. Use CSS instead.
CSS syntax: <input type="image" style="float:right">
CSS Example: align input image
In our CSS tutorial you can find more details about the float property.
Value | Description |
---|---|
left | Left-aligns the image (this is default) |
right | Right-aligns the image |
top | Top-aligns the image |
middle | Middle-aligns the image |
bottom | Bottom-aligns the image |