|
Using the IFRAME tag
An IFRAME is basically a frame embedded in a page. So instead of having a frame
set which defines the frames, you embed a frame within a normal page. It has
basically the same attributaries too. Heres an example:
<iframe src="http://www.mworld.us" width="100%" height="400"
frameborder="5" scrolling="yes"></iframe>
Make sure that you close off your IFRAME tag. You can add elements into the
middle but this can make it really confusing. If you don't close it however,
none of the rest of the page will load as the content will be classed as being
in the IFRAME.
The IFRAME tag uses the normal src to define the page that it loads of the
width and height which can be pixels or percent as with any element. You can
also add a frameborder or if you don't want a frame border you can put frameborder="0"
so you don't see any difference between the IFRAME page and the normal page.
You can also chose whether it has scroll bars or not:
scrolling="no"
scrolling="yes"
But again this is just like a normal frame.
The IFRAME tag is useful when you want to embed something inline with your
page such as adding a forum page embedded into your homepage. It is also useful
for banners as the code and measure impressions and keep the rest of the information
on the page out of sight easily.
|