Write a program to define an HTML page layout using frame tag.

1
2
3
   <!-- First Frame Code(save this file as frame1.html) -->
4
    <html>
5
    <body>
6
        This is the 1st frame html document.
7
    </body>
8
    </html>
9
    <!-- End of file -->
10
        
11
   <!-- Second Frame Code(save this file as frame2.html) -->
12
13
    <html>
14
    <body>
15
    This is the 2nd frame html document.
16
    </body>
17
    </html>
18
    <!-- End of file -->
19
20
    <!-- Now, make a final file save this file as frame.html -->
21
22
    <html>
23
    <frameset cols="250,*">
24
    <frame src="1frame.html" name="menu">
25
    <frame src="2frame.html" name="main">
26
    </frameset>
27
    </html>
28
    <!-- End of file -->
29
30
    

Output

1
2
        No Output Available
3
        

Rate the Code

Reviews are published after a quick safety check (usually within 24 hours).

Reviews are public. Developers can see basic device specifications to respond. Learn more

Core Concept of HTML page layout using the frame tag

The main purpose of <frameset> is to divide the browser window into sub-parts as frames. So that each frame can load a different HTML file.

In this example, frame1.html represents the left side portion, frame2.html represents the right side, and frame.html represents the center part.

Why was it used?

This frameset was used in the 90s and at the beginning of the 2000s because, at that time, CSS layout tools like flexbox or grid did not exist, so to fix the website navigation menu, this frameset tag was used.

Where was it used?

  • Admin Dashboard & Portals: In old time the banking software, college management systems, or control panels had a left menu and right-side main content.
  • Documentation Sites: The chapter list on the left side and the details of the chapter on the right side.

Is this frameset still relevant?

No, this frameset tag is fully deprecated in HTML by the W3C (which sets all the HTML standards); also, the <frame> and <noframe> tags are deprecated.

So, modern websites don’t contain these tags. And today, the use of <frame>, <noframe>, and <frameset> is a bad practice.

Advantages of this Program

  • To load complete navigation or separated content at one time, so the loading speed is fast, and the consumption of data is also less.

Limitations of this Program

  • Poor for SEO (Search Engine Optimization): Any search engine couldn’t crawl the content inside the frameset tags correctly.
  • Responsiveness Problem: This tag was not compatible with small screens or mobile devices.
  • URL Sharing Problem: The page inside the frame or the HTML URL was not shareable.

Alternatives in Today’s World

CSS Flexbox, CSS Grid, and HTML <iframe> (inline frame) are alternative ways, and modern JavaScript frameworks like Angular and React are used, which are SEO friendly and responsive.

What is the meaning of deprecation?

Anything like a package, tag, a feature, or an app or software that is no longer used in the next version is known as deprecation or deprecated.

License: This program's source code is open-sourced under the MIT License, while the rest of the program's text content and overall dhimanp platform and brand content remain proprietary under dhimanp.

Submit your modified code

Your submissions are published after a quick safety check (usually within 7 days).

Submissions are public. Developers can see basic device specifications to respond. Learn more

Disclaimer

The information that you shared with us will be publicly visible, and everyone can see your information. And we (dhimanp) are not responsible if anyone misuses this information. We can remove any submitted code at any time for better transparency.

Privacy Policy

If you share your data with us by submitting your code for credit, then we may show your full name, school or college name, and city name on our website.

We are not using this data to track you and are not selling this data to anyone.

If you want to remove your name from our website, you can contact us, and we will remove your name from our website. In the removal process, full credit, including your full name, school or college, city, and code, will be removed from our website.