{{HTMLRef}}
Het HTML <div> element is een algemene container voor flow content, die opzichzelf niets is.
Het kan gebruikt worden om elementen te groeperen voor stijl-doeleinden (doormiddel van een class of id), of omdat ze attribuut waardes delen, zoals lang. Het mag alleen gebruikt worden als er geen alternatief semantisch element is (zoals {{HTMLElement("article")}} of {{HTMLElement("nav")}}).
Content categories | Flow content, palpable content. |
---|---|
Permitted content | Flow content. |
Tag omission | {{no_tag_omission}} |
Permitted parent elements | Any element that accepts flow content. |
DOM interface | {{domxref("HTMLDivElement")}} |
Attributes
This element includes the global attributes.
The align attribute is obsolete; do not use it anymore.
Examples
<div> <p>Any kind of content here. Such as <p>, <table>. You name it!</p> </div>
Result
Any kind of content here. Such as <p>, <table>. You name it!
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', 'grouping-content.html#the-div-element', '<div>')}} | {{Spec2('HTML WHATWG')}} | No changes since the latest snapshot |
{{SpecName('HTML5 W3C', 'grouping-content.html#the-div-element', '<div>')}} | {{Spec2('HTML5 W3C')}} | Obsoleted align |
{{SpecName('HTML4.01', 'struct/global.html#h-7.5.4', '<div>')}} | {{Spec2('HTML4.01')}} |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | 1.0 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
See also
- Semantic sectioning elements: {{HTMLElement("section")}}, {{HTMLElement("article")}}, {{HTMLElement("nav")}}, {{HTMLElement("header")}}, {{HTMLElement("footer")}}
- {{HTMLElement("span")}} element for styling of phrasing content