The <frame> tag is used to create a frame and defines one window frame in a <frameset>.
Note − The <frame> tag deprecated in HTML5.
Attribute | Description |
---|---|
frameborder | Display a border around a frame |
longdesc | Page that contains a long description of the content of a frame |
marginheight | Top and bottom margins of a frame |
marginwidth | Left and right margins of a frame |
name | Name of a frame |
noresize | A frame is not resizable |
scrolling | Whether or not to display scrollbars in a frame |
src | URL 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 −
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%">