What is div tag? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

What is div tag?

I don't understand "div" tag, actually where I should use and for what? If anyone have time please help. (I'm a Beginner so don't laugh at me)

22nd Feb 2017, 11:32 AM
Rayhan Rony
Rayhan Rony - avatar
6 Respuestas
+ 2
Div is uses as container for other tags or text. It shows as block (it breaks line and shows separately from other lines). But you can use it to create any (even inline) markup. It is used in modern sites and frameworks like bootstrap as a main construction brick.
22nd Feb 2017, 12:20 PM
Aleksander Ashkov
+ 2
Br cannot contain any data in it. It used only inside text to insert breakline. On the contrary, the meaning of the div is to be a container for other data. In fact, using of css allow you to change behavior of almost any tags. And so div can act like <i> and so on. And you can even create and use your own tags with own behavior.
22nd Feb 2017, 12:33 PM
Aleksander Ashkov
+ 2
Sorry if i repeat myself. Phone lost connection
22nd Feb 2017, 3:21 PM
Aleksander Ashkov
+ 1
Br works inside text. It breaks lines inside text. Div is a container, it is surrounding text or other tags. Additionally it break make next tag goes from new line. The same is tag <p> and some other. In fact you can change default functionality of almost all tags with css. And div for example, will not break lines. Try css display:inline;
22nd Feb 2017, 3:21 PM
Aleksander Ashkov
0
there is a break line tag also so what is the difference between div and (br/)?
22nd Feb 2017, 12:25 PM
Rayhan Rony
Rayhan Rony - avatar
0
Thank you👍👍👍
22nd Feb 2017, 12:34 PM
Rayhan Rony
Rayhan Rony - avatar