All TalkersCode Topics

Follow TalkersCode On Social Media

devloprr.com - A Social Media Network for developers Join Now ➔

How To Create Frames In HTML

Last Updated : Mar 11, 2024

How To Create Frames In HTML

In this tutorial we will show you the solution of how to create frames in HTML, in HTML, frames are very important thing in html. If you want to make a creative website like if you add a topic name in webpage and when user have to know about topic.

He/she clicks on topic name. After this, without opens new page. You use there frames tag, with the help of this you allow webpage to open other webpage in current webpage.

Hence, this is a very creative way to show your data. Without loss of current page and any other distraction.

Step By Step Guide On How To Create Frames In HTML :-

Now, as we know that frame is a child tag of parent tag named as frameset. Also, there are many ways to use this tag because of their attributes. Sometimes, we use this to divide the webpage vertically and other times horizontally.

There is one more feature that you are able to divide your webpage in not only two, three or more. You can divide your webpage in as much as divisions you want.

For, this you have to set width in frameset tag and have to make frame tags equal to number of division of width.

<!DOCTYPE html>
      <html>
        <head>
          <title> Title of the document<title>
/head>
<frameset cols="33%,34%,33%">
    <frame src="1.html">
    <frame src="2.html">
    <frame src="3.html">
</frameset>
<noframes>
    <body>
        your browser does not support frameset
    </body>
</noframes>
</html>

Now, there is another example in rows also:

<!DOCTYPE html>
      <html>
        <head>
          <title> Title of the document<title>
/head>
<frameset rows="20%,60%,20%">
    <frame src="1.html">
    <frame src="2.html">
    <frame src="3.html">
</frameset>
<noframes>
    <body>
        your browser does not support frameset
    </body>
</noframes>
</html>
  1. First, we write <! DOCTYPE html> which we used as an instruction to the web browser about what version of HTML file is written in.
  2. Secondly, the <html> tag is used to indicate the beginning of an HTML document.
  3. As above now <head> tag is used to contain information about web page. In this tag a <title> tag is used which helps us to specify a webpage title. Both <head> and <title> tags are Paired tags. So, both have </head> and </title> ending tags respectively.
  4. Here is something special for you. Today, you not have to create body after head close.
  5. Hence, here we represent two example in first we divide webpage vertically and in second we divide page horizontally.
  6. The number of frames is equal to number of division that are in frameset. You are also able to apply events like when you click on link in first or second div.
  7. The link will be open in third div. Hence, there are many ways with the help of which frames can be used.
  8. At last, the <body> and <html> tags are closed with </body> and </html> respectively.

Conclusion :-

In conclusion, here we want to say that with the help of this article we are able to create frames with the help of frameset and know about how to use frames in html.

Now, here is one assignment from our side to make a nested frameset with the help of nested frames i.e. rows and cols. I hope this tutorial on how to create frames in HTML helps you.

Author Image About Pragati

Experienced coding content writer who enjoys breaking down complex concepts in programming languages like Java, Python, C, and C++. Over three years of experience producing interesting and relevant content for a variety of entities. Committed to providing concise and easy-to-understand articles that assist readers in easily understanding technology and industry trends in the world of coding and software development.

Follow Pragati On Linkedin 🡪