Widely availableSupported across all major browsers. Safe to use in production.

Overview

The <div> HTML element is the generic container for content.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
1
12
1
1
18
1
DOM API

The HTMLDivElement interface provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating div elements.

1
12
1
3
18
1
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)

Syntax

HTML
<div class="card">
  <div class="card-header">Title</div>
  <div class="card-body">
    <p>Content</p>
  </div>
</div>

Live demo

layoutcontainer

Div element in Flexboxlayout. container create.

PreviewFullscreen

gridlayout

CSS Grid and div. combination in dashibo-d stylelayout.

PreviewFullscreen

Div and semntickelement

Div is meaning container.semntickelement and. Compare usage.

PreviewFullscreen

Use cases

  • Using <div>

    The <div> HTML element is the generic container for content.

Cautions

  • May not be supported in older browsers.

Accessibility

  • Verify how this element is announced by screen readers.

Powered by web-features