HTML frames are used to divide your browser window into multiple sections where each section can load a separate HTML document. A collection of frames in the browser window is known as a frameset. The window is divided into frames in a similar way the tables are organized: into rows and columns.
To use frames on a page we use <frameset> tag instead of <body> tag. The <frameset> tag defines how to divide the window into frames. The rows attribute of <frameset> tag defines horizontal frames and cols attribute defines vertical frames. Each frame is indicated by <frame> tag and it defines which HTML document shall open into the frame.
Following is the example to create three horizontal frames:
See this example:
Output:
Let's put above example as follows, here we replaced rows attribute by cols and changed their width. This will create all the three frames vertically:
See this example:
Output:
An iframe is used to display a web page within a web page.
When the target of a link matches the name of an iframe, the link will open in the iframe.