<div>
The <div> HTML element is the generic container for flow content. It has no effect on the content or layout until styled in some way using CSS (e.g., styling is directly applied to it, or some kind of layout model like Flexbox is applied to its parent element).
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
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 flow content.
Cautions
- May not be supported in older browsers.
Accessibility
- Verify how this element is announced by screen readers.