div
div
This page has been flagged with the following issues:
High-level issues:
W3C Recommendation
Summary
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 |
|---|
HTML information
| Closing Tag | required |
|---|---|
| CSS Display | block |
Examples
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.
HTML
<div id="mainContent"> <h1>The HTML Times</h1> <div class="sportsSection"> <h2>Sports</h2> </div> </div>
Notes
Remarks
Standards information
- Document Object Model (DOM) Level 2 HTML Specification, Section 1.6.5
- HTML 4.01 Specification, Section 7.5.4
Members
The div object has these types of members:
- [#events Events]
- [#methods Methods]
- [#properties Properties]
Events
The div object has these events. {
Related specifications
| Specification | Status | Related Changes |
|---|---|---|
| WHATWG HTML Living Standard | Living standard | |
| HTML 4.01 Specification | Recommendation | |
| HTML 5 | Candidate Recommendation | The align attribute is obsolete. |
Compatibility
Desktop
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic Support | 1+ | 1+ | 6+ | 10+ |
5.1+ |
Mobile
| Feature | Android | BlackBerry | Chrome for mobile | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Opera Mini | Safari Mobile |
|---|---|---|---|---|---|---|---|---|
| Basic Support | 1.5+ | ? | ? | ? | ? | ? | ? | ? |
See also
Related articles
HTML
- div
This article contains content originally from external sources.
Portions of this content come from the Mozilla Developer Network
: Article
Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]
This tool helps to make and review comments inline.
How to Use
insert instructions, with images, here