All TalkersCode Topics

Follow TalkersCode On Social Media

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

How To Divide Page In HTML

Last Updated : Mar 11, 2024

How To Divide Page In HTML

In this article we will show you the solution of how to divide page in HTML, with the <div> tag and CSS, we can divide an entire webpage into sections in HTML.

A div tag divides a page into horizontal sections by default. However, you can create the webpage's vertical divisions using the float feature of CSS.

The most crucial tag in HTML is the <div> tag, which is used in the majority of publications.

Other HTML tags are thought of as fitting inside the div tag. This makes it possible to apply several HTML tags to a specific area of the document.

An HTML page can be divided into many sections using the <div> tag.

A tag in HTML serves as a part of the information on the HTML page. You must include the necessary HTML tags within the tag in order to break a page into sections.

In order to build sections and apply styles, it is utilized to organize different HTML tags.

Given that the div element is a block-level tag, it contains the complete width.

Hence, rather than starting on the same line, each div element will start on a different line.

Step By Step Guide On How To Divide Page In HTML :-

<html>
   <head>
      <title>TC</title>
<style type=text/css>
p{
  background-color:gray;
  margin: 10px;
}
div
{
  color: white;
  background-color: 009900;
  margin: 2px;
  font-size: 25px;
}
</style>
</head>
 <body>
<div > div tag </div>
   <div > div tag </div>
   <div > div tag </div>
   <div > div tag </div>
   </body>
</html>
  1. The browser is informed of the HTML version we are using in our first line, which is <HTML>. Tags are the foundation of HTML documents.
  2. Next comes the body tag, which defines the body of the webpage. You can create this same content for your site in one specific location.
  3. The style property is used for the color in the following step.
  4. After that we close style and head.
  5. Then we open the body then we create a divide page using the div object.
  6. Finally, after closing all tags, </body></html> but also code should be executed.

Conclusion :-

As a result, we have successfully learned how to divide page in HTML. The div tag is another name for the division tag.

The div tag in HTML is used to segment the information into several sections.

Both an open() and a closing() tag are present in a division tag, and closing the tag is required.

Since it enables us to segment the information on a web page and designate particular portions for various sorts of information or purposes, it Div element has proven most helpful in web development.

I hope this article on how to divide page in HTML helps you and the steps and method mentioned above are easy to follow and implement.

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 🡪