Checked At:05:12
7 Guests
0 Users
Online doing the past 15 Minutes!
brugbart.com - Edition/Last Updated: 13. October 2008
Posted The: 02/09/2008 - AT: 17:02
Edited The: 01/10/2008 - AT: 3:57
The frame element in HTML is used together with framesets, to insert a page inside another page.
Using frames is considered a bad practice, since they might pose usability issiues, as well as being difficult to index by search engines.
Standard Attributes.
| Attribute: | Value: | Description: | DTD: |
| Attrs | Other Attributes | Id, class, style, title | F |
| longdesc | URI | link to long description. | F |
| name | Character data. | Name of frame for targetting. | F |
| src | URI | Source of frame content. | F |
| frameborder | 1|0 | Frame borders? | F |
| marginwidth | Pixels | The margin width in Pixels. | F |
| marginheight | Pixels | The margin height in Pixels. | F |
| noresize | noresize | Allow resizeing? | F |
| scrolling | yes|no|auto | Scroll bars? | F |
DTD. Defines which document type the attribute is allowed. S=Strict, T=Transitional, F=Frameset.
Simple example.
<frame src="First-Page.html">
The full example
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<head>
<title>My first Frameset</title>
</head>
<frameset cols="25%,75%">
<frame src="First-Page.html">
<frame src="Second-Page.html">
</frameset>
</html>The src attribute is required, and the frame element doesn't need to be closed.
To make your links open in the correct frame, you should name each frame using the name attribute, and set the target attribute of your links to the frames name attribute.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <html> <head> <title>Usage of the target attribute with Frames</title> </head> <frameset cols="15%,*"> <frame name="MenuFrame" src="Menu.html"> <frame name="ContentFrame" src="Content.html"> </frameset> </html>
The links which would open in the "ContentFrame" would then appear as follows:
<a href="About.html" target="ContentFrame">About Page</a>
Extra examples dealing with Frames.
Because frames are so rarely used, layout examples will be included here, or posted as comments.
Author: BlueBoden
Comments: [0]


Checked At:05:12
7 Guests
0 Users
Online doing the past 15 Minutes!
This page was created in 0.0785708427429 seconds
Welcome Guest