Het HTML <div> element is een algemene container voor flow content, en heeft geen specifieke betekenis.
Het kan gebruikt worden om elementen te groeperen voor stijl-doeleinden (doormiddel van een class of id), of omdat ze attribuutwaarden delen, zoals lang. Het mag alleen gebruikt worden als er geen alternatief semantisch element is (zoals <article>
of <nav>
).
Content categories | Flow content, palpable content. |
---|---|
Permitted content | Flow content. |
Tag omission | None, both the starting and ending tag are mandatory. |
Permitted parent elements | Any element that accepts flow content. |
DOM interface | HTMLDivElement |
Attributen
Dit element bevat de 'global attributes'.
Het 'align' attribuut is verouderd; niet meer gebruiken.
Voorbeelden
<div> <p>Een willekeurige tekst hier.</p> </div>
Resultaat
Een willekeurige tekst hier.
Specificaties
Specificatie | Status | Commentaar |
---|---|---|
HTML Living Standard The definition of '<div>' in that specification. |
Living Standard | Geen veranderingen sinds laatste snapshot. |
HTML5 The definition of '<div>' in that specification. |
Recommendation | align verouderd |
HTML 4.01 Specification The definition of '<div>' in that specification. |
Recommendation |
Browser compatibiliteit
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basis support | 1.0 | (Yes) | (Yes) | (Yes) | (Yes) |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basis support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
Bekijk ook
- Semantische sectie elementen:
<section>
,<article>
,<nav>
,<header>
,<footer>
<span>
element voor het stijlen van content