HTML iframes : Java Glossary
home H words local find no local find frame, full screen Google search web for topic jump to footer translate with Babelfish 2008-03-30 by Roedy Green ©1996-2008 Canadian Mind Products
Go to : punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
iframes
Iframes are like Windows into which you can pour an entire separate document. They may optionally have scrolling. They are not universally supported and are not permitted in strict DTDs. The latest Opera, Firefox, Sea Monkey, Netscape and IE all support them. There are typically used to contain ads, such as the one on the right: Here is the code to generate it:
For some reason you must use a separate </iframe> tag. You can’t say <iframe … />. The html you insert into the frame must be a complete page, not just a fragment. It needs a minimal header with at least this much:
Iframe Tags
Attribute Value Description
align left
right
top
middle
bottom
Specifies how to align the entire iframe relative to the surrounding text.
frameborder 1
0
Specifies whether or not to display a frame border.
height pixels
%
Defines the height of the iframe. Includes the height of the horizontal scroll bar if any. It also must include room for padding and margins around the components enclosed. Oddly, even when you have scrolling=no you must still include room for the horizontal scroll bar. The display will be not as tall as you request. This way you can add or remove scrolling without changing the size of the payload window. You specify the size of the window including the possibly invisible scroll bars.
longdesc URL An URL to a long description of the frame contents, not the long description itself.
marginheight pixels Defines the top and bottom margins of the iframe.
marginwidth pixels Defines the left and right margins of the iframe.
name frame_name Specifies a unique name, within the page, of the iframe (to use in scripts).
scrolling yes
no
auto
Define scroll bars. I found that when you scroll the coloured background is only as big as in the initial window. I could not get backgrounds to work properly and eventually used a transparent background to mask the error.
src URL The URL of the document to show in the iframe.
width pixels
%
Defines the width of the iframe. Includes the width of the vertical scroll bar if any. It also must include room for padding and margins around the components enclosed.
I have found that classes applied to an iframe are ignored. So I put the whole <iframe …>…</iframe> in a <div class="iframe">…</div >; sandwich to give me a handle to control the iframe’s properties. Life gets complicated with the Russian dolls of nested containers. You will just have to experiment to get the effects you want.
CSS
FORMS
FORMS: specification
HTML 4.01 Specifications: current HTML Standard
HTML Cheat Sheet

CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.16] The information on this page is for non-military use only.
You are visitor number 11. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/jgloss/htmliframes.html J:\mindprod\jgloss\htmliframes.html