HTML frames are generally used in an HTML program. It is used to split your browser window into numerous sections where every section can load an individual HTML document. In the browser window, a collection of frames is called a frameset. The window is separated into frames in the same way the tables are prepared: into columns and rows.
To build frames on a web page, we use <frameset> tag instead of using <body> tag. The <frameset> tag shows how to split the window into the frames. The rows feature of <frameset> tag shows horizontal frames and cols feature defines the vertical frames.
Each frame is signified by <frame> tag and it signifies which HTML page shall open into the frame.
cols: used for defined the columns
rows: used for defined the rows
name: used for indicate which frame a document should be loaded into your specified target.
scrolling: This attribute controls the scrollbars on the frame. This takes values either "yes", "no" or "auto".
For example scrolling="no" means it should not have scroll bars.
<frameset cols="25%,25%,10%" rows="25%,25%,10%">
See the main attributes of Frameset:
- cols - It specifies how many columns are existing in the frameset and the size of every column.
- rows - This attribute acts just like the cols attribute and takes similar values, but it is used to show the rows in the frameset.
- border - This attribute shows the width of the border of every frame in the pixels.
- frameborder - It specifies whether a three-dimensional border should be viewed between the frames. This element takes value either 0 (no) or 1 (yes).
- framespacing - It specifies the amount of space amid the frames in a frameset. This can take any numeral value.
See the main attributes of Frame Tag
- src - It is used to give the file name that should be loaded in the frame. Its value can be any URL.
- name - It allows you to give a specific name to a frame. It is used to specify which frame a document should be used in.
- frameborder - It specifies whether or not the borders of that frame are displayed.
- marginwidth - It allows you to indicate the width of the space amid the right and left of the frame's borders and the frame's content. The value can be given in the pixels.
- marginheight - It allows you to indicate the height of the space between the bottom and top of the frame's borders and its contents. The worth is given in the pixels.
- noresize - By default, you can resize any frame by dragging and clicking on the borders of a frame.
- scrolling - It controls the appearance of the scrollbar that show on the frame. This takes values either "no", "yes" or "auto".
- longdesc - It allows you to provide a link to another page containing a long description of the frame.