Div tag

Why, when, where we use “div” tag in html ?

Div tags are basically used to make content saperate from one and other. Before, that it was table which developers use to make a website. You can search on Google for details.

Examples: you might want a sidebar, with various content, so you’d wrap it in a div, give it a width and float it left or right. You would wrap all of the main content in a div, give it a width and float it in the other direction. You might also have a footer section with various things in it, so wrap that all in a div.

Div is the default block level element. It’s partner, span, is the default inline element. Both of them are used when something else isn’t more semantically appropriate.

Div tag is generally used when we have divide a webpage into different sections.