What does <div> tag do? | Sololearn: Learn to code for FREE!


What does <div> tag do?

7/3/2019 4:52:39 AM

Anurag Kumar

2 Answers

New Answer


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


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.