Iframe: Height &Width

Use the height and width attributes to specify the size of the iframe. The attribute values are specified in pixels by default, but they could also be in percentage.

<iframe src="boo.html" width="350" height="350"></iframe>

<iframe src="boo.html" width="60%" height="100%"></iframe>

Note: The height of the iframe is always this high, regardless of which percentage is used -- you'd have to use pixels if you want the iframe taller. The reason for this is because the height of the page is not determined, there is no "parent" element with a height defined. Therefore, this "child" element doesn't know how tall to grow.


Back button Table of Contents Next button