Latest web development tutorials

HTML iframe align property

HTML iframe tag Reference Manual HTML <iframe> tag

Examples

Right-aligned <iframe>:

<iframe src="http://www.w3cschool.cc/" width="200" height="200" align="right">
</iframe>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Although align attribute is obsolete, but the property still get the support of all major browsers.


Definition and Usage

HTML5 does not support the <iframe> align attribute. Use CSS instead.

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

Attribute specifies align <iframe> with respect to the alignment of the surrounding elements.

<Iframe> element is an inline element (does not insert a new row on the page), which means text and other elements can be around at their surroundings. Therefore, align attributes can help us provisions <iframe> with respect to the alignment of the surrounding elements.


Compatibility Notes

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

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

CSS Example: right-floating iframe

In our CSS tutorial you can find more information about the float property detail.


grammar

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

Property Value

描述
left 向左对齐 iframe。
right 向右对齐 iframe。
middle 居中对齐 iframe。
top 在顶部对齐 iframe。
bottom 在底部对齐 iframe。


HTML iframe tag Reference Manual HTML <iframe> tag