English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete List of HTML Tags

HTML: <iframe> align attribute

The align attribute specifies the alignment of <iframe> based on surrounding elements, and the <iframe> element is an inline element (it does not insert a new line on the page), which means text and other elements can wrap around it. Therefore, specifying the alignment of <iframe> based on surrounding elements may be very useful.

 HTML <iframe> tag

Online Example

Right-aligned <iframe>:

<iframe src="frame_a.htm" width="200" height="200" align="right">
</iframe>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Although the align attribute is deprecated, it is still supported by all major browsers.

Definition and Usage

HTML5 The align attribute of <iframe> is not supported. Please use CSS instead.

in HTML 4.01 The align attribute of <iframe> is deprecated.

The align attribute specifies the alignment of <iframe> based on surrounding elements.
The <iframe> element is an inline element (it does not insert a new line on the page), which means text and other elements can wrap around it. Therefore, specifying the alignment of <iframe> based on surrounding elements may be useful.

Compatibility notes

in HTML 4.01 In the <iframe> element's align attribute has been deprecated. Please use CSS instead.

CSS syntax: <iframe style="float:right">

CSS Example: Float iframe to the right

In our CSS tutorial, you can find more about float attribute details.

Syntax

<iframe align="left|right|middle|top|bottom">

Attribute value

ValueDescription
leftAlign iframe to the left.
rightAlign iframe to the right.
middleCenter align iframe.
topAlign iframe at the top.
bottomAlign iframe at the bottom.
 HTML <iframe> tag