How to Create Frames in HTML

How to Create Frames in HTML. Html frames are valuable for dividing the web page or the web browser into various segments, they separate segments then load differently.

A-frame displays the content objective of its container. Multiple frames form a collection and are identified as a frameset. The method can be considered similar to the adjustment of rows and columns in a table. The frame tag has been objected to HTML5.

Each frame has a frame tag to show. The smooth frame is set by the row attribute of the frame tag, and the upward attribute is set by the column attribute of the frame tag in the HTML document. The same window in one frame might display an inactive banner, a second navigation menu, etc.

How to Create Frames in HTML?

Frames Column Syntax.

<cols ="10%,80%,10%">

Frames ROW Syntax.

<rows ="10%,80%,10%>

<frameset> Attributes

Not Supported in HTML5.

  • Col
  • Row
  • frameborder:
  • Frame spacing:

There are four important attributes of the <frameset> and we discuss it here

Col:) The vertical frames are provided by the col attribute. However, It can be specified in 2 ways:

Pixels:) absolute values can be specified in pixels. If we have to perform three vertical frames, we can give the value: cols=”30,40,30″.
Percentage:) The percentage (%)of the browser window can be considered. If we have to produce three vertical frames, we can give the value: cols=30%, 40%, 30%
We can also create use of the wildcard here (*) and let the wildcard take the remaining of the window which persists un-mentioned.

cols=30%, 40%,30%

/* Not Supported in HTML5*/
<frameset cols="30%, 40%,30%">
<frame src="home.html"></frame>
<frame src="about.html"></frame>
<frame src="contact.html"></frame>
</frameset>

Output:)

Home.htmlAbout.htmlContact.html
  1. Rows: The horizontal frames are provided by the row attribute. It defines the rows in a frameset. If we have to create three horizontal frames we use, value: rows=30%, 40%, 30%,

We can also set the height of each row as we had done in the state of columns earlier.

<frameset>fdsfdfoi</frameset>
<frameset rows="30%, 40%,30%">
<frame src="home.html"></frame>
<frame src="about.html"></frame>
<frame src="contact.html"></frame>
</frameset>

Output:)

Home.html
About.html
Contact.html
  1. frame border🙂 If a three-dimensional border needs to be performed between frames then we use this property. The value that the attribute takes is either 1 or 0.

value: frameborder=”0” means no border.

Frame spacing:) This attribute defines the number of spaces between frames in a frameset. Any integer value can be given here for this attribute.
Value: framespacing=”10″ means between the frames there should be the spacing of 10 pixels.

Conclusion

Frame technology is not supported by quite a number of browsers these days. For many a period, it is mentioned that the contents of the webpage are not displayed properly for smaller devices, like smartphones, tablets, etc. Anyhow, it is great to have knowledge of what existed so that better standards could be developed to be cooperative with new technologies.

Leave a Reply

Your email address will not be published. Required fields are marked *