Easy Tutorial
❮ Tag Optgroup Att Select Required ❯

HTML <iframe> align Attribute

HTML <iframe> Tag

Example

Right-aligned <iframe>:


Browser Support

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


Definition and Usage

In HTML 4.01, the align attribute of <iframe> is deprecated.

The align attribute specifies the alignment of the <iframe> relative to the 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, the align attribute helps us specify the alignment of the <iframe> relative to the surrounding elements.


Compatibility Notes

In HTML 4.01, the align attribute of <iframe> is deprecated. Use CSS instead.

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

CSS Example: Float iframe to the right

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


Syntax

Attribute Values

Value Description
left Aligns the iframe to the left.
right Aligns the iframe to the right.
middle Centers the iframe.
top Aligns the iframe at the top.
bottom Aligns the iframe at the bottom.
❮ Tag Optgroup Att Select Required ❯