You are here: Reference > HTML > attributes > align (embed, img, object, ...)

align attribute (embed, img, object, ...)

Browser support:
Sets the object's position with respect to the surrounding text.
This attribute is deprecated. Use the vertical-align style property instead.
JavaScript page for this attribute: align. You can find other example(s) there.

Possible values:

String that sets the type of alignment.
One of the following values:
absbottom
Aligns the bottom of the object with the absolute bottom of the surrounding text.
absmiddle
Aligns the middle of the object with the middle of the surrounding text.
baseline
Aligns the bottom of the object with the baseline of the surrounding text.
bottom
Aligns the bottom of the object with the bottom of the surrounding text.
left
Default. Aligns the object to the left of the surrounding text.
middle
Aligns the middle of the object with the surrounding text.
right
Aligns the object to the right of the surrounding text.
texttop
Aligns the top of the object with the absolute top of the surrounding text.
top
Aligns the top of the object with the top of the surrounding text.
Default: left.

Example HTML code 1:

This example illustrates the use of the align attribute:
The bottom of the image is aligned
<img src="picture.gif" align="bottom"/>
to the bottom of the surrounding text content.
<br /><br /><br />
The top of the image is aligned
<img src="picture.gif" align="top"/>
to the top of the surrounding text content.
Did you find this example helpful? yes no

Example HTML code 2:

Recommendation:
The bottom of the image is aligned
<img src="picture.gif" style="vertical-align:text-bottom;"/>
to the bottom of the surrounding text content.
<br /><br /><br />
The top of the image is aligned
<img src="picture.gif" style="vertical-align:top;"/>
to the top of the surrounding text content.
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content