HTML <div> Tag


In an HTML document, the div element establishes a divide or section. The <div> tag in an HTML page creates a generic container that is commonly used to organize items. This tag is also generally known as the <div> element.

The <div> tag is used to encapsulate HTML components, which are subsequently styled using CSS or changed with JavaScript.

The class or id attribute makes it simple to decorate the <div> element.  Browsers, by default, put a line break before and after the <div> element.

Syntax

Example

Preview

Supported Browsers

Element Chrome Firefox Safari Edge / IE Opera
<div> Yes Yes Yes Yes Yes