Frame Basics

Frame Basics

Frames in HTML are a way to divide a web page into multiple independent sections, each with its own content. Each frame can contain its own HTML document and can be loaded and reloaded independently of the other frames.

Frames are defined using the <frameset> tag, which specifies the layout and size of the frames within the page. Within the <frameset> tag, you define the individual frames using the <frame> tag, which specifies the content to be loaded in each frame.

Here’s an example of a basic frameset:

<!DOCTYPE html>

<html>

  <head>

    <title>My Frameset</title>

  </head>

  <frameset cols=”25%, 75%”>

    <frame src=”menu.html”>

    <frame src=”content.html”>

  </frameset>

</html>

In the above example, the <frameset> tag defines a two-column layout, with the left column taking up 25% of the width and the right column taking up 75%. The <frame> tags define the content to be loaded in each frame, with “menu.html” being loaded in the left frame and “content.html” being loaded in the right frame. It’s important to note that the use of frames in HTML has fallen out of favor in recent years, due to various usability and accessibility issues. As a result, it’s generally recommended to use alternative techniques, such as CSS and JavaScript, for achieving the same layout effects.

Apply for HTML Certification

https://www.vskills.in/certification/certified-html-designer

Back to Tutorials

Tables
Introduction to HTML and XHTML

Get industry recognized certification – Contact us

keyboard_arrow_up
Open chat
Need help?
Hello 👋
Can we help you?