HTML img align Attribute
HTML <img> tag
Definition and Usage
The align attribute specifies the horizontal and vertical alignment of the image
in relation to the surrounding text/elements.
The image element is a floating element (does not start a new line in the
HTML page), so text and other elements can wrap around it.
Compatibility Notes
The align attribute of the img element was deprecated in HTML 4.01
and is not supported in XHTML 1.0 Strict DTD.
Use CSS instead.
CSS syntax: <img style="float:left" />
In our CSS tutorial you can find more details about the
float property.
Syntax
<img align="alignment" />
|
Syntax Example
Attribute Values
Value |
Description |
left |
Align the image left of the surrounding text. |
right |
Align the image right of the surrounding text. |
top |
Align the image on the top of the surrounding text. |
bottom |
Align the image on the bottom of the surrounding text. |
Browser Support

The attribute is deprecated, but still supported in all major browsers.
Example
Image align example:
<img src="demo_img.jpg"
alt="W3Schools example image"
align="left" />
|
Image align example:
|
Try-It-Yourself Demos
img align
attribute example
Set the alignment of an image.
In CSS:
img float
Set an image to float left of the text.
HTML <img> tag
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|