Posts Tagged ‘frame’

HTML iFrames

An iFrame is a HTML element which allows a HTML document to be embedded within another. It can be useful for including external content in your webpage without having it coded in your page.

It’s worth noting that iFrames are distinct from standard Frames which are actually a special kind of HTML page consisting of several external documents. Unlike a standard frame, an iFrame is embedded within the page, just like an image…

frameset-vs-iframes

As the page is scrolled the iFrame will move up and down along with the rest of the page content. However, the contents of the iFrame is completely independent from the surrounding page and will not in itself be effected by it. iFrames are very easy to construct….

<iframe src="page.html" width="200px" height="300px">
    This text will appear if the user’s browser doesn’t support the use of iFrames.
</iframe>
Basically all you need are the contained document (src), width and height. Of course the standard HTML attributes: id, class, title, style can be used to modify it. There are also some specific attributes to the iFrame tag:
  • scrolling – This may be set to any of three setting: “on” – scrollbars appear, “off” – scrollbars never appear, and “auto” – the default scrollbars appear as they are needed.
  • marginwidth, marginheight – This can be used to set the distance between the frame border and the frame’s contents.

Sorted.

Web Design Coleraine