+ 1
why should we use div tag
4 Answers
+ 2
div id divider tag
we can logically divides part of webpage using div .
it is not necessary but we shots have to use.
+ 2
You use it to divide blocks of content, kinda how you use the <p> tag to describe a paragraph of content. In reality all a <p> does is add a break at the end of the tag you can do the same with <br> but by using <div> or <p> when someone else looks at your code it will become easier for them determine the structure of your content thus being easier to read and understand.
+ 1
DIV tag may seem useless in the beginning -I've been asking your question too-
But as you go further you will find it so useful for generally two reasons:
1- Obviously to keep your work neat and clear and to be able to find parts of your website easily.
2- When you get to the styling you may find your self in need to make bunch of elements have the same style and so you'll put them all inside a DIV tag and just write the styling code once.
Hope I helped ^_^
+ 1
div tag is for division of your articles. it acts as a container where you can put almost any other HTML tags used inside the body tag.
People use it with CSS and give different id like <div id="top"> <div id="rightbox"> <div id="main content">
<div id="bottom"> u can give different border, text color and independently format the content of each paragraph with CSS like the CSS code below
CSS
//general text color inside paragraph
p {color:aqua;}
//overwrites the aqua color with green
#top p {color:green;}
//overwrites aqua with red
#bottom p{ color: red;}
This independent ability makes it efficient in styling.