Frames are most typically used to have a menu in one frame, and content in another frame. When someone clicks a link on the menu that web page is then opened on the content page. Here is a classic example of a basic "index" frameset with a menu on the left and content on the right.
HTML Code:
<html>
<head>
</head>
<frameset cols="30%,*">
<frame src="menu.html">
<frame src="content.html">
</frameset>
</html>
Frame Set:
Here's the example: Frame Index
frameset - The parent tag that defines the characteristics of this frames page. Individual frames are defined inside it.
frameset cols="#%, *"- Cols(columns) defines the width that each frame will have. In the above example we chose the menu (the 1st column) to be 30% of the total page and used a "*", which means the content (the 2nd column) will use the remaining width for itself.
frame src="" -The location of the web page to load into the frame.
A good rule of thumb is to call the page which contains this frame information "index.html" because that is typically a site's main page.
0 comments:
Post a Comment