Blog
Please correct any errors below and try again.
All About HTML Frames
Frames in HTML permits a number of html documents which can be displayed inside one browser window at one time. The significance of this is that there is one webpage that contains no content. However, this page specifies the browser which web pages the user requires to open. Frames usually have a menu in each frame and the content is contained in another frame. When the user selects a particular link from the menu, the related web page opens on the content page. Hence with the assistance of the frames users can open more than one HTML documents in the same browser window. These frames are independent of each other. The web browser however, needs to keep track of more than one HTML document which can be difficult.
An example of frames can be seen below. Use your favorite editor, or even Notepad to copy and paste the code below. Name the page as “index.html” and view it in your favorite browser:
HTML Code:
<html>
<head>
</head>
<frameset cols="30%,*">
<frame src="menu.html">
<frame src="content.html">
</frameset>
</html>
Here’s the breakdown of the commands:
frameset - The characteristics of the frame tag is defined by a parent tag. Inside these individual frames are defined.
frameset cols="#%, *"-
The code “="#%, *" defines the width of each frame is going to have.
Hence the first column is 30% width of the total web page.
The code “*” signifies that the second column is going to use the width of the remaining page.
frame src="" –This is the location of the web page where it is going to load.
Frameset Tag –
• The <frameset> tag signifies how a window is to be divided into frames.
• The framesets specifies a set of columns or rows.
• The values that are given to these rows or columns signify the width of each row or column.
Frame Tag –
• The <frame> tag shows the html document that needs to be put inside each frame.
Usually you will see grey lines that don’t look good in-between frames. With the help of frameborder and framespacing, these can be fixed.
frameborder="#" - A zero value shows no "window" border.
border="#"- Modifies the border width, used by Netscape.
framespacing="#" -Modifies the border width, used by Internet Explorer.
When a frame has borders that a user can see, he might try resizing by dragging it. To stop users from doing so add noresize="noresize" to the <frame> tag. You might also add <noframes> tag for those browsers which shall not support frames. Hence when frames are used, they can look neat and organized.
Comments
New Comment
About
Welcome to the SnobbySlice blog! Here we post design and developer-centric tutorials, articles, and giveaways. Read up and comment on some of our great content!
