Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM IFrame align property

IFrame align property

Frame/IFrame Object Reference Frame/IFrame Object


Definition and Usage

The align property sets or returns the value of the align attribute of an iframe element.

The align property specifies how to align the iframe relative to the surrounding text.

Tip: 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, it can be aligned according to the surrounding text.

Syntax

iframeObject.align=

value

The align property can have the following values:

Value Description
left iframe left aligned
right iframe right aligned
middle iframe center aligned
top iframe top aligned
bottom iframe bottom aligned

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the align property


Example

Example

iframe right aligned:

document.getElementById("myframe").align="right";

Try it »


Frame/IFrame Object Reference Frame/IFrame Object