Please note, this is a STATIC archive of website from 10 Sep 2022, does not collect or store any user information, there is no "phishing" involved.

HTML <div> Tag

Topic: HTML5 Tags ReferencePrev|Next


The <div> (short for division) tag is generic container for flow content, which has no default rendering or meaning. The <div> tag is extensively used to define the structural sections of a document and to layout a web page using CSS.

The following table summarizes the usages context and the version history of this tag.

Placement: Block
Content: Block, inline, and text
Start/End Tag: Start tag: required, End tag: required
Version: HTML 3.2, 4, 4.01, 5

Tip: The <div> element is ideal for grouping elements for associating the styles and scripts (using the class or id attributes), since it doesn't convey any meaning about its contents and also doesn't have any default styling or meaning.


The basic syntax of the <div> tag is given with:

HTML / XHTML: <div> ... </div>

The example below shows the <div> tag in action.

<div class="welcome-box">
    <p>Hi, welcome to our website.</p>

Tag-Specific Attributes

The following table shows the attributes that are specific to the <div> tag.

Attribute Value Description
align left
Obsolete Aligns the content inside a div element.

Global Attributes

Like all other HTML tags, the <div> tag supports the global attributes in HTML5.

Event Attributes

The <div> tag also supports the event attributes in HTML5.

Browser Compatibility

The <div> tag is supported in all major modern browsers.

Browsers Icon

Basic Support—

  • Firefox 1+
  • Google Chrome 1+
  • Internet Explorer 2+
  • Apple Safari 1+
  • Opera 4+

Further Reading

See tutorial on: HTML Layout, CSS Alignment.

Related tag: <span>.

Bootstrap UI Design Templates