HTML HTML Tutorial HTML Forms HTML Graphics HTML Media HTML APIs HTML Tags



HTML Tag: frameset

The <frameset> tag is used to define a set of frames in an HTML document. Frames are used to divide a web page into multiple sections, each of which can display a different document. This can be useful for creating complex layouts or for displaying content from multiple sources on a single page.

The <frameset> tag is typically used in conjunction with the <frame> tag, which is used to define the individual frames within the frameset. The <frameset> tag can also be used with the <noframes> tag, which is used to provide content for browsers that do not support frames.

Attributes

The <frameset> tag supports several attributes that can be used to control the layout and behavior of the frameset:

  • cols: Specifies the width of each column in the frameset, separated by commas.
  • rows: Specifies the height of each row in the frameset, separated by commas.
  • border: Specifies the width of the border around each frame.
  • frameborder: Specifies whether or not to display a border around each frame.
  • framespacing: Specifies the amount of space between frames.
  • name: Specifies a name for the frameset.

Example

Here is an example of a simple frameset:

  <frameset cols="25%,75%">
    <frame src="menu.html" name="menu">
    <frame src="content.html" name="content">
  </frameset>

This frameset defines two frames, one that takes up 25% of the width of the page and displays the contents of menu.html, and one that takes up 75% of the width of the page and displays the contents of content.html. The name attribute is used to give each frame a name that can be targeted by links or scripts.

It is important to note that framesets are not recommended for use in modern web development, as they can cause accessibility and usability issues. Instead, developers are encouraged to use modern layout techniques such as CSS grid and flexbox.

References

Activity