Example for frameset |HTML|

Introduction

    Framesets in HTML provide a powerful way to divide a web page into multiple frames, each capable of displaying separate HTML documents. This enables developers to create more complex layouts and improve user navigation. In this blog post, we'll dive into framesets, their structure, and how to use them effectively.
    Framesets allow you to divide a web page into multiple frames, each containing its own HTML document. Framesets are defined using the <frameset> tag, and individual frames are defined using the <frame> tag. Frames can be arranged in rows or columns, creating a grid-like layout.

Code

frame1.html

 
     
    <html>
    <head>
    <title>frameset and links </title>
    </head>
    <body bgcolor="red">

    <font align="center">
    <h1>
    Welcome to My college!
    </h1>
    </font>
    </body>
    </html>
       
     


frame2.html

 
        
    <html>
    <head>
    <title>frameset and links  </title>
    </head>
    <body bgcolor="yellow">
    <h1>Courses  </h1>
    <ul>
    <li>BCA
    <li>Bsc.Physics
    <li>BA English
    <li>BA Economics
    <li>BBA
    <li>Bcom
    </ul>
    </body>
    </html>
          
        


frame3.html

 
            
    <html>
    <head>
    <title>frameset and links  </title>
    </head>
    <body bgcolor="blue">
    <h1>Our Speciality  </h1>
    <p>This is one of the best college. We provide a quality education for the students.
    </body>
    </html>
              
            


Head.html

 
                
    <html>
    <head>
    <title>frameset and links</title>
    </head>
    <frameset rows="20%,*">
    <frame src="frame1.html">
    <frameset cols="20%,*">
    <frame src="Main.html">
    <frame name="asd">
    </frameset>
    </frameset>
    </html>
                  
                


Main.html

 
                    
    <html>
    <head>
    <title>frameset and links</title>
    </head>
    <body>
    <a href="frame2.html" target="asd">Courses</a>
    <br>
    <a href="frame3.html" target="asd">About</a>
    </body>
    </html>
                    
                    


Output







Usage

  • Use any text editor
  • Copy the HTML code for each file from the blog post. For example, copy the code for frame1.html, frame2.html, frame3.html, head.html, and Main.html.
  • Paste HTML Code: Paste the copied HTML code into separate files in your text editor. Make sure to save each file with the appropriate file name and .html extension.
  • Save each file to your desired location on your computer. You can create a new folder to organize the files if needed.
  • Once saved, you can verify the files by opening them in a web browser to ensure they display correctly.

Conclusion

     Framesets offer a flexible way to structure web pages, allowing developers to divide content into separate sections. By using framesets, you can create more complex layouts and improve navigation for users. However, it's important to use framesets judiciously and consider accessibility and usability implications. Experiment with framesets in your projects to see how they can enhance your web development efforts.

Post a Comment

0 Comments