| Frameset Tag
The frameset tag defines a general layout of a web page that uses frames. It creates a table of documents; in which each rectangle (called a frame) holds a separate document. In its simplest form, it states how many columns or rows will be there in the frameset.
Attributes of Frameset Tag
Cols and Rows
Cols and Rows set the quantity and sizes of the columns and rows in a frameset. The value for each attribute is a comma separated by a list of sizes (in percentage).
Example: |
|
| <frameset rows=”20%,*” cols=”40%,*”> |
| <frame src= “title.html” name=”title”/> |
<frame src=”body.html” name=”body”/>
<frame src=”data.html” name=”data” />
<frame src=”image1.jpg” name=”image” />
|
| <frameset> |
|
|
Frameborder
Frameborder determines whether there should be 3D borders between the frames. It takes up two values-Yes and No. Yes sets the 3D frame border which is the default value. The value no does not set a 3D border.
Example: |
|
| <frameset rows=”30%,*” frameborder=no> |
| </frameset> |
| |
Framespacing and Border
Framespacing and border are one and the same thing. It sets the space between the frames which indicates how big the borders are. Internet explorer understands only framespacing and netscape understands only border.
Example: |
|
| <frameset rows=”30%,*” framespacing=30 border=30> |
| </frameset> |
| |
Bordercolor
Bordercolor sets the color of the border in the frameset.
Example: |
|
| <frameset rows=”20%,30%,*” bordercolor=red> |
| <frame src= “title.html” name=”title” scrolling=yes > |
<frame src=”body.html” name=”body” scrolling=no/> <frame src=”data.html” name=”data” scrolling=auto/> |
| </frameset> |
| |
NoFrames Tag
A large percentage of people on the web use browsers which cannot read frames. The <noframes> tag holds the text that should be displayed for people who don’t have frames. It should be the outermost frameset element.
Example: |
|
| <frameset rows=”20%,*”> |
| <frame src= “title.html” name=”title”/> |
<frame src=”body.html” name=”body”/>
<noframes>
<p>this text is for those people who cannot view the frames.</p>
</noframes> |
| </frameset> |
| |
IFrame Tag
The <iframe> tag creates a web page, which has an inline frame that contains another document. It creates a frame that sits in the middle of a regular non framed page. It works like the <img> tag, the only difference being that instead of pitting a picture on the web page it puts up another web page.
Example: |
|
| <iframe src=”hello.html”> |
| If you can see this then your browser does not understand iframes. |
| <frame src=”body.html” name=”body”/> |
| </iframe> |
| |
Attributes of IFrame Tag
Src
Src indicates the URL of the document which should go in the frame.
Example: |
|
| <iframe src=”hello.html”> |
If you can see this then your browser does not understand iframes. |
</iframe> |
| |
Height and Width
Height and Width attribute set the dimension of the inline frame.
Example: |
|
<iframe src=”hello.html” width=450 height=100> |
If you can see this then your browser does not understand iframes. |
</iframe> |
| |
Name
Name indicates the name of the inline frame. It works in the same way as in the frame tag.
Example: |
|
| <iframe src=”tables.html” width=450 height=100 name=”tables”> |
| </iframe> |
| |
Frameborder
Frameborder indicates if the inline frame should have a border around it. The default value is 1, which sets a border. When a border is not required then the value is set to 0.
Example: |
|
| <iframe src=”tables.html” width=450 height=100 name=”tables” frameborder=0> |
| </iframe> |
| |
Marginwidth
Marginwidth sets the internal left and right margins of the internal frame. It works similarly as it works in the frame tag.
Example: |
|
| <iframe src=”tables.html” width=450 height=100 name=”tables” frameborder=0 marginwidth=2> |
| </iframe> |
| |
Marginheight
Marginheight sets the internal top and bottom margins of an inline frame. It works similarly as in the frame tag.
Example: |
|
| <iframe src=”tables.html” width=450 height=100 name=”tables” frameborder=0 marginheight=2> |
| </iframe> |
| |
|