<img src="" align="">
Browser |
|
---|---|
Type |
The align attribute of the IMG element specifies the alignment of an image.
<img src="example.gif" alt="Example" align="top">
Attribute | Value | Explanation |
---|---|---|
align=" " | vertical alignment | |
top | aligns to the top | |
middle | aligns to the middle | |
bottom | aligns to the bottom (default) | |
floats image | ||
left | the image floats to the left (the text wraps to the right of the image) |
|
right | the image floats to the right (the text wraps to the left of the image) |
The use of this attribute is deprecated. (Use CSS instead)
Please see the "stopping text wrapping" when you specified the left or right.
Example
<p>
<img src="image/example.jpg" alt="Example" align="top">
Aligns to the top
<br>
The text aligns to the top of the image.
</p>
- Output
-
Aligns to the top
The text aligns to the top of the image.
<p>
<img src="image/example.jpg" alt="Example" align="middle">
Aligns to the middle
<br>
The text aligns to the middle of the image.
</p>
- Output
-
Aligns to the middle
The text aligns to the middle of the image.
<p>
<img src="image/example.jpg" alt="Example" align="bottom">
Aligns to the bottom (Default)
<br>
The text aligns to the bottom of the image.
</p>
- Output
-
Aligns to the bottom (Default)
The text aligns to the bottom of the image.
<p>
<img src="image/example.jpg" alt="Example" align="left">
Aligns to the left
<br>
The image floats to the left.
<br>
And the text wraps to the right of the image.
<br clear="left">
Clears the left
</p>
- Output
-
Aligns to the left
The image floats to the left.
And the text wraps to the right of the image.
Clears the left
<p>
<img src="image/example.jpg" alt="Example" align="right">
Aligns to the right
<br>
The image floats to the right.
<br>
And the text wraps to the left of the image.
<br clear="right">
Clears the right
</p>
- Output
-
Aligns to the right
The image floats to the right.
And the text wraps to the left of the image.
Clears the right