What is <div> tag in html | Sololearn: Learn to code for FREE!

+3

What is <div> tag in html

I can't understand the use of div tag and I can see its use in almost all websites so if any one can help me !

5/11/2017 5:53:32 PM

Vaibhav Singh Sikarwar

5 Answers

New Answer

+5

In simpler words it's a rectangle box which by default invisible , when you add CSS background-color and other properties it becomes visible . In this box you can keep other things like a set of books (in here paragraphs , images , lists ,tables ,etc.) The advantage of using div is that if we want to move or assemble books it would be easier to move them together if they are in a container (box) other than moving or organising one by one . So when we move or place a div using CSS every book ( objects )in it moves along with it , so if we know which things are meant to be together , it becomes much easier to organize them .

+4

It is a division, or section, like Claudio said. Most of the times it acts as a sort of "container" to other tags or blocks. So that you have a reference (mostly by adding an "id" to the div) to use for all the content inside it.

+4

Additionally we can draw through them , ( not suggested ) but I usually do , each of these codes are using mainly div's- https://code.sololearn.com/Wo8H7sTdK77j/?ref=app https://code.sololearn.com/WIE1o6Cv7y8k/?ref=app https://code.sololearn.com/Wp4p959M9CbC/?ref=app

+3

<div> is a section every area in a web can be a div and in most cases it should be a div to keep the HTML code clean and maintaneable

+3

<div> is a generic container for all things not related to other existing semantically more specific tags...