Creating frames in a site is one of the most necessary things which a HTML programmer should know in web development. Frames are used to display individual HTML document making the rest of places not changing. Frames divide the whole webpage into sessions. For ex. The whole sidebar in a webpage can be a part of one frame and can keep the content place dynamic, showing the results for every clicks.
We need two create two HTML files in order to show it in two frames in the main html document. So initially we are going to make two HTML files. Open your Notepad application and code your first HTML document and save it with file extension “.html”. You can search for my tutorial for assistance.

Picture shows how to save a text file in order to get a HTML file from it. Pictures below shows two HTML files I made as an example for showing you how to insert file to a frame. First HTML file create webpage of Red background and you can understand that by looking at the code I made. Second file create one with Green background.
<html>
<head>
<title>First Doc</title>
</head>
<body bgcolor = "GREEN">
</body>
</html>
<html>
<head>
<title>Background</title>
</head>
<Frameset rows = "40%,60%" border = "0">
<frame src = "first.html" name =”first”>
<frame src = "second.html" name=”second">
</frameset>
</html>
Src : Specify the address of a HTML file
Rows : Percentage at which a webpage is to be divided.
Name : Name a frame
OUTPUT:




We need two create two HTML files in order to show it in two frames in the main html document. So initially we are going to make two HTML files. Open your Notepad application and code your first HTML document and save it with file extension “.html”. You can search for my tutorial for assistance.

<html>
<head>
<title>First Doc</title>
</head>
<body bgcolor = "RED">
</body>
</html>
<head>
<title>First Doc</title>
</head>
<body bgcolor = "GREEN">
</body>
</html>
Now we need to create the master file in which all these HTML files are to be filled. Make sure you make all these file in same directory.
<head>
<title>Background</title>
</head>
<Frameset rows = "40%,60%" border = "0">
<frame src = "first.html" name =”first”>
<frame src = "second.html" name=”second">
</frameset>
</html>
Src : Specify the address of a HTML file
Rows : Percentage at which a webpage is to be divided.
Name : Name a frame
OUTPUT:




No comments