<div> HTML Tag

Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more
Element of
HTML Document Structure Before And After HTML5 – Here’s What Changed
What does <div> HTML Tag do?
The <div> element defines an arbitrary block of content which can be placed and styled as a single unit.
Display
block
Usage
structural

Just a block

The <div> element has no particular semantic meaning. It simply defines a block of content which can be styled as a single unit on a page. Prior to the semantic elements added in HTML5, it was the main structural element defining sections of an HTML Document. Today, there are a number of better structural elements which can be styled the same way as <div> elements, but add semantic meaning, identifying their purpose in the overall document. These include:

Adoption of these semantic structural elements is not universal, but they are widely supported on browsers. So, while you will continue to see <div> elements in existing websites (and front-end frameworks like Twitter’s Bootstrap), you should use the newer elements whenever appropriate.

Adam is a technical writer who specializes in developer documentation and tutorials.

Browser Support for div

iefirefoxchromeedgesafariopera
AllAllAllAllAllAll