CoderTools Web site

HTML IFrames

Creating IFrames


IFrame stands for inline frame. This is used to embed a browser window in an html page much like an image would be displayed on a page. So you can position and size it using css. If the contents of the iframe is too big for the size of the iframe then scroll bars will appear.

Examples for <iframe>


The example shows one iframe in the middle of this page. The width is set to the full 100% of the parent element. You can have many iframes in a page.
    <iframe src="html_iframe_tag.aspx" width="100%"/>Give it a go!

Example in action:


Attributes for <iframe>


Name Values Description
src url A url of a page to display in the iframe
align top
middle
bottom
left
right
(Deprecated) Position the iframe within text. If left then text will flow down the right, and vice versa.
height number
% e.g. 50%
The height in pixels, or height as a percentage.
width number
% e.g. 50%
The width in pixels, or width as a percentage.
frameborder 1
0
the value 1 creates a separator between the frame and surrounding frames.
longdesc url a link to a file that contains a long description of the frame contents.
marginheight number e.g. 10 A value in pixels(px) which is the size of the margin between the top of the frame and the contents, and between the bottom of the frame and its contents
marginwidth number e.g. 10 Value in pixels which is the size of the margin between the left edge of the frame and its contents, and between the right edge of the frame and the frame contents.
name text (Deprecated) Used by target attributes in links to identify which frame to load a page in.
scrolling yes
no
auto
If yes scroll bars appear in the frame. If no then scrollbars dont appear. If auto then scroll bars appear when frame contents are larger than the frame size. Auto is the default.

8/19/2017 6:38:47 PM
Terms Of Use | Privacy Statement | Copyright 2006-2015 © Independence Software LLP