HTML <iframe> alignAttributes
Examples
A right-aligned <iframe>:
</iframe>
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
Although the align attribute is deprecated, it is still supported by all major browsers.
Definition and Usage
HTML5 does not support the <iframe> align attribute. Use CSS instead.
In HTML 4.01, the align attribute of <iframe>is deprecated.。
The align attribute specifies the alignment of the <iframe> relative to 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 surround it. Therefore, the align attribute helps us specify the alignment of the <iframe> relative to 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 the iframe to the right
In our CSS tutorial, you can find more about thefloat propertyin detail.
Syntax
Attribute Values
| Value | Description |
|---|---|
| left | Left-aligns the iframe. |
| right | Right-aligns the iframe. |
| middle | Center-aligns the iframe. |
| top | Aligns the iframe at the top. |
| bottom | Aligns the iframe at the bottom. |
HTML <iframe> Tag Other Extensions