0 votes
217 views
in HTML by (3.5k points)
edited

How to use div tag in html to divide the page?

2 Answers

0 votes
by (3.5k points)
selected by
 
Best answer

The div tag stands for Division tag. This is used in HTML to make divisions of content in the web page like text, images, header, footer, navigation bar, etc.  Div tag has two parts like: 

  1. open(<div>) and
  2.  closing (</div>) tag and it is mandatory to maintain the tag. 

The Div is the most used tag in web page development because it has power to separate respective data in the web page and also a particular section can be created for particular data or function in the web pages.

  • Div tag is Block level tag
  • Generic container tag
<html>
   <head>
      <title>div tag demo</title>
<style type=text/css>
  
p{
  background-color:gray;
  margin: 100px;
}
  
div
{
  color: white;
  background-color: 009900;
  margin: 4px;
  font-size: 35px;
}
</style>
   
</head>
  
 <body>
   <div > div tag demo 1   </div>
   <div > div tag  demo 2 </div>
   <div > div tag  demo 3 </div>
   <div > div tag  demo 4 </div>
   
   </body>
</html>

 

 

0 votes
by (3.5k points)
edited

The div tag stands for Division tag. This is used in HTML to make divisions of content in the web page like text, images, header, footer, navigation bar, etc.  Div tag has two parts like: 

  1. open(<div>) and
  2.  closing (</div>) tag and it is mandatory to maintain the tag. 

The Div is the most used tag in web page development because it has power to separate respective data in the web page and also a particular section can be created for particular data or function in the web pages.

  • Div tag is Block level tag
  • Generic container tag
<html>
   <head>
      <title>div tag demo</title>
<style type=text/css>
  
p{
  background-color:gray;
  margin: 100px;
}
  
div
{
  color: white;
  background-color: 009900;
  margin: 4px;
  font-size: 35px;
}
</style>
   
</head>
  
 <body>
   <div > div tag demo 1   </div>
   <div > div tag  demo 2 </div>
   <div > div tag  demo 3 </div>
   <div > div tag  demo 4 </div>
   
   </body>
</html>

 

Related questions

0 votes
1 answer 142 views
asked Aug 19, 2022 in HTML by codelikepro (3.5k points)
0 votes
1 answer 187 views
asked Aug 19, 2022 in HTML by codelikepro (3.5k points)
0 votes
1 answer 160 views
asked Jun 24, 2023 in HTML by Doubtly (98.9k points)
0 votes
1 answer 102 views
asked Aug 19, 2022 in HTML by codelikepro (3.5k points)
0 votes
1 answer 125 views
asked Aug 19, 2022 in HTML by codelikepro (3.5k points)
0 votes
1 answer 143 views
asked Jun 24, 2023 in HTML by Doubtly (98.9k points)

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

561 users

...