The WebPlatform project has been discontinued when the Stewards partnership agreement ended in September 2015. This site has been frozen, and the assets we have created will remain.


< html‎ | elements
Jump to: navigation, search


This article is In Progress.

W3C Recommendation


The div element (<div>) is a generic block-level container that has no semantic value other than the one that you give it via id or class attributes. It can be used for a variety of purposes including the styling of common elements, or for grouping elements with common attributes.

Overview Table

DOM Interface HTMLDivElement

The div tag contains no native semantics, and is only effectively used for styling purposes.

In some cases, other elements may be more suitable, like article, section, fieldset, nav, header, footer, or main


This example shows two DIVs, one inside the other, that define a main content section, then a subsection within that. Each DIV is semantically defined using a class or ID.


<div id="mainContent">
   <h1>The HTML Times</h1>
   <div class="sportsSection">

Related specifications

Specification Status Related Changes
HTML 5.1 W3C Working Draft
HTML 5 W3C Recommendation
HTML 4.01 W3C Recommendation

See also

Related articles


  • div


This article contains content originally from external sources.

Portions of this content come from the Mozilla Developer Network cc-by-sa-small-wpd.svg: Article

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]