HTML Frames

A webpage can be divided into multiple sections. You can also call these sections as HTML frames. These sections are independent of each other. Each section represents a different webpage.

Simply put, one webpage can divide into several sections and show other webpages in those sections. In this way many other webpages can be displayed inside a webpage. That is, a separate webpage can be loaded in every section.

In a single frame you can create a header and menus can be created in any other frame. Such a webpage can be made a footer and another web page can be used as a main window.

All web browsers do not support Frames and due to Frames the webpage appears differently on different computers. Frames are used very little. Use frames only when you need them right.

Create First HTML Frames

When you use frames, the <body> tag is not used. <Frameset> tag is used to define frames in any webpage. The rows and cols of this tag are 2 attributes.

Values ​​of these attributes are given in%. If a webpage is considered to be 200%, then the value you give will cover the same width as the frame. With rows attributes, you divide the webpage into rows and columns are created from cols attributes to the webpage.

Example:-

<html>
<frameset rows="15,80">
<frame src="myfirstwebpage.html">
<frame src="mysecondwebpage.html">
</frameset>
</html>

In the above example, a page has been divided into 2 frames. The individual frames are configured by using the <frame> tag. By defining the src attribute of <frame> tag you define the URL of the webpage.

Which frame would show it depends on the order of that frame. The webpages you provide will automatically load into those frames.

Frame Attributes of HTML

cols – You want to create frameset of how many columns it is defined by this attribute. Also the size of all the columns is also defined.

rows – How many rows do you want to divide frameset, this is defined by this attribute and their size also defines you with this attribute.

frameborder – This attribute defines whether or not you want to show the border of the frames. This attribute of yes and no can be just 2 values.

framespacing – This attribute is used to define the space between the frames.

<html>
<frameset rows="15,80">
<frame src="myfirstwebpage.html">
<frame src="mysecondwebpage.html">
</frameset>
</html>

Demo