iframe alignment


<iframe src="" align="">

Browser
Internet Explorer Firefox Opera
Type
Inline-block

The align attribute of the IFRAME element specifies the alignment of the iframe.


<iframe src="example.html" align="left"> - </iframe>


Attribute Value Explanation
align=" " vertical alignment
top aligns to the top
middle aligns to the middle
bottom aligns to the bottom (default)
floats images
left the iframe floats to the left
(the text wraps to the right of the iframe)
right the iframe floats to the right
(the text wraps to the left of the iframe)

Please see the "stopping text wrapping" when you specified the left or right.

Tips and Notes

This can be specified with CSS. Please see the "Related Document" for details on CSS.


Example

Aligns to the top

<p>
<iframe src="iexample_b.html" width="200" height="130" align="top">Alternate content</iframe>
Aligns to the top
<br>
The text aligns to the top of the iframe.
</p>
Output

Aligns to the top
The text aligns to the top of the iframe.


Aligns to the middle

<p>
<iframe src="iexample_b.html" width="200" height="130" align="middle">Alternate content</iframe>
Aligns to the middle
<br>
The text aligns to the middle of the iframe.
</p>
Output

Aligns to the middle
The text aligns to the middle of the iframe.


Aligns to the bottom

<p>
<iframe src="iexample_b.html" width="200" height="130" align="bottom">Alternate content</iframe>
Aligns to the bottom
<br>
The text aligns to the bottom of the iframe.
</p>
Output

Aligns to the bottom
The text aligns to the bottom of the iframe.


Aligns to the left

<p>
<iframe src="iexample_b.html" width="200" height="130" align="left">Alternate content</iframe>
Aligns to the left
<br>
The iframe floats to the left.
<br>
And the text wraps to the right of the iframe.
<br clear="left">
Clears the left
</p>
Output

Aligns to the left
The iframe floats to the left.
And the text wraps to the right of the iframe.
Clears the left

Aligns to the right

<p>
<iframe src="iexample_b.html" width="200" height="130" align="right">Alternate content</iframe>
Aligns to the right
<br>
The iframe floats to the right.
<br>
And the text wraps to the left of the iframe.
<br clear="right">
Clears the right
</p>
Output

Aligns to the right
The iframe floats to the right.
And the text wraps to the left of the iframe.
Clears the right