HTML DOM align Property

Definition and Usage

The align property can be set or returned to specify how to align the iframe according to the surrounding text.

Syntax

iframeObject.align=left|right|top|middle|bottom

Example

The following example will align the iframe to the right according to the surrounding text:

<html>
<body>
<iframe src="frame_a.htm" id="frame1"></iframe>
<p>Some text. Some text. Some text. Some text.</p>
<script type="text/javascript">
document.getElementById("frame1").align="right";
</script>
</body>
</html>

Try It Yourself (TIY)

Setting the Alignment of <iframe>