What does <div> tag do? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What does <div> tag do?

3rd Jul 2019, 4:52 AM
Anurag Kumar
Anurag Kumar - avatar
2 Answers
+ 1
The div element is a block-level element, meaning it will have a line break at the start and end of it. It contains text and other elements
3rd Jul 2019, 5:09 AM
Airree - avatar
On its own, div doesn't do much, it is invisible. It can serve as container for other elements, to hold together contents that belong together logically (semantically) or visually, for example to contain a menu bar on your page. Its other common usage is styling and animation with css, as with stylesheets you can turn div's into graphical elements of various shapes, colors and sizes and move and transform them.
3rd Jul 2019, 5:44 AM
Tibor Santa
Tibor Santa - avatar