
PLACEMENT CONSIDERATION FOR FLOATING FRAME, seen in FRAME 5:
This floating iframe is placed in a SPECIFIC place on your page using the ABSOLUTE positioning.
You can have a problem with placing your iframe over an element (table, image, etc) that is CENTERED!
This iframe code is far more difficult to get to work right and takes more effort. It also may not appear correctly in other than IE.
|
|
When your visitor sees your page using the SAME resolution as you built the page, the iframe will line up over the element the way you intended.800x600
![]() notice placement of center blue box!
|
When your visitor sees your page using a HIGHER resolution than your setting the element will move to the middle, but the iframe stays exactly where you set it! 1024x768
![]() Much better to use a LEFT alignment for your element (table, image, etc) below so it matches alignment when screen resolution changes!
|
Understanding the basic iFrame code:
|
||
<iframe name="FRAMENAME" src="contentpage.htm" width="100" height="280" frameborder="0" scrolling="no"></iframe>
|
||
Code elements:
|
Used in samples:
|
What is it?
|
iframe name
|
FRAME5
|
Name of the frame (call it anything you want)
No spaces, no symbols except - and _
Multiple iframes: each iFrame needs a different name
|
src
|
cb.htm
|
Address of the Contents page that you want to see in the frame
If you want to see a blank box until you click a link, use about:blank as your address.
Better choice: start with a basic page with an introduction, etc.
|
width
|
166
40%
|
Wide: Enter number of pixels for the window
Or enter the percentage for the window size
|
height
|
93
60%
|
High: Enter number of pixels for the window
Or enter the percentage for the window size
|
frameborder
|
1 = show a 3d edge
0 = no border
|
3d edge on the iFrame window
Using 0 makes the edge invisible.
|
scrolling
|
auto = browser decides
yes = always have
no = do not show
|
Scroll bar: if your content page is too long or wide to fit into the iFrame, then scroll bars appear automatically as needed, even without the scrolling="auto" code!
Adding scrolling="no" to your code will stop the scroll bar from showing. But be careful! If you have content outside the window, your visitor will not be able to see it.
|
Other iframe settings you can choose to use though I have no samples made with them:
<iframe name="FRAMENAME" src="contentpage.htm" width="100" height="280" frameborder="0" scrolling="no" hspace=10 vspace=5 ></iframe>
|
||
hspace
vspace
|
10
5
|
External Space AROUND the iframe.
Adust the hspace (horizontal-space on right and left) or
vspace (vertical-space above and below the iframe.
|
<body topmargin=10 leftmargin=5>
|
Internal Space WITHIN the iframe. This code is placed into the body of the content page to adjust the margin within the iframe. On FRAME 5 sample, I set the margins to 0. In CSB, use Insert> HTML to place the code.
|
|