Computer >> Computer tutorials >  >> Programming >> HTML

HTML <frame> Tag


The <frame> tag is used to create a frame and defines one window frame in a <frameset>.

Note − The <frame> tag deprecated in HTML5.

AttributeDescription
frameborderDisplay a border around a frame
longdescPage that contains a long description of the content of a frame
marginheightTop and bottom margins of a frame
marginwidthLeft and right margins of a frame
nameName of a frame
noresizeA frame is not resizable
scrollingWhether or not to display scrollbars in a frame
srcURL of the document to show in a frame

Let us now see an example to implement the tag.

Example

<!DOCTYPE html>
<html>
<frameset cols="30%,30%,20%,20%">
   <frame src="https://www.tutorialspoint.com/codingground.htm">
   <frame src="https://store.tutorialspoint.com/">
   <frame src="https://www.tutorialspoint.com/tutorialslibrary.htm">
   <frame src="https://www.tutorialspoint.com/programming_examples/">
</frameset>
</html>

Output

This will produce the following output displaying different pages in individual frames −

HTML <frame> Tag

In the above example, we have four frames in a frameset −

<frameset cols="30%,30%,20%,20%">
   <frame src="https://www.tutorialspoint.com/codingground.htm">
   <frame src="https://store.tutorialspoint.com/">
   <frame src="https://www.tutorialspoint.com/tutorialslibrary.htm">
   <frame src="https://www.tutorialspoint.com/programming_examples/">
</frameset>

The frames are given the following divisions inside the frameset on the basis of % −

frameset cols="30%,30%,20%,20%">