HTML div

A section in a document that will have a light blue background color:

h3This is a heading/h3

pThis is a paragraph./p

/divTry it Yourself Definition and Usage

The div tag defines a division or a section in an HTML document.

The div element is often used as a container for other HTML elements to style them with CSS or to perform certain tasks with JavaScript.

Tip:The div element is very often used together with CSS, to layout a web page.

Note:By default, browsers always place a line break before and after the div element. However, this can be changed with CSS.

The align attribute not supported in HTML5.

The div tag also supports theGlobal Attributes in HTML.

The div tag also supports theEvent Attributes in HTML.

Most browsers will display the div element with the following default values:


Your message has been sent to W3Schools.