Friday, July 26, 2024

HTML Frames

HTML frames were used to divide the browser window into multiple sections, each displaying a different HTML document. The <frameset> tag defined the layout of frames, and <frame> specified the content of each frame. However, frames are now obsolete and not supported in HTML5, having been replaced by more modern layout techniques like CSS Flexbox and Grid. Frames often caused usability and accessibility issues, which led to their deprecation.

Examples (for historical context):

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

  <frame src="sidebar.html">

  <frame src="main.html">

</frameset>

<frameset rows="50%, 50%">

  <frame src="top.html">

  <frame src="bottom.html">

</frameset>


HTML Code:


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HTML Tutorial</title>
</head>
<body>
    <h1>HTML Frames</h1>
    <p>Frames are used to divide the browser window into multiple sections, each capable of displaying a different document.</p>
    <frameset cols="25%, 75%">
      <frame src="sidebar.html">
      <frame src="main.html">
    </frameset>
    
    <frameset rows="50%, 50%">
      <frame src="top.html">
      <frame src="bottom.html">
    </frameset>

    <pre>
        &lt;frameset cols="25%,75%"&gt;
            &lt;frame src="frame1.html"&gt;
            &lt;frame src="frame2.html"&gt;
        &lt;/frameset&gt;
    </pre>
    <p>Note: The <code>&lt;frameset&gt;</code> element is deprecated in HTML5. Use iframes instead.</p>

</body>
</html>

The Output of the above code:



HTML Tutorial

HTML Frames

Frames are used to divide the browser window into multiple sections, each capable of displaying a different document.

        <frameset cols="25%,75%">
            <frame src="frame1.html">
            <frame src="frame2.html">
        </frameset>
    

Note: The <frameset> element is deprecated in HTML5. Use iframes instead.