Advertisement
❮ Previous: <dialog> Next: <dl> ❯

<div>

HTML <div> (Division) Tag

Example

<div>
  <h2>This is a heading</h2>
  <p>This is a paragraph.</p>
</div>

Try this code ❯

Meaning

The <div> element indicates a generic block of content that should be treated as a unit for scripting or styling purposes.

By default, browsers always place a line break before and after the <div> element.

Version: HTML 3.2, 4, 4.01, 5


Standard Syntax

<div>...</div>


Advertisement

Global Attributes

The <div> element also supports the Global Attributes in HTML.


Event Attributes

The <div> element also supports the Event Attributes in HTML.


By Default CSS Value(s)

Most of the browsers will display the <div> element with the following by default value(s)

div {
  display: block;
}
❮ Previous: <dialog> Next: <dl> ❯
Advertisement