article
element.General Document Structure
These are elements unique to the document. Instead of showing inline examples we highlight the respective element in this document.
Document root
- Selectors
html
/:root
- Example
- Highlight document root.
Content root
- Selector
body
- Example
- Highlight content root.
The document’s main content
- Selector
main
- Example
- Highlight main content.
The document’s main header
- Selector
:where(body, body > div) > header
- Example
- Highlight main header.
- See also
- For the
header
element in general see Sectioning Scope Specific Elements.
The document’s main footer
- Selector
:where(body, body > div) > footer
- Example
- Highlight main footer.
- See also
- For the
footer
element in general see Sectioning Scope Specific Elements.
The current target element
- Selector
:target
- Example
- Highlight me.
Sectioning
Sections
- Selector
section
- Example
-
I am a section
element.section
element stand-alone - Selector
article
- Example
-
I am an article
element stand-alone - Selector
aside
- Example
-
aside
element stand-alone - Selector
nav
- Example
-
nav
element stand-alone
Heading Content
- Selectors
h1
,h2
,h3
,h4
,h5
,h6
- Examples
-
I am an
h1
element.h1
element stand-aloneI am an
h2
element.h2
element stand-aloneI am an
h3
element.h3
element stand-aloneI am an
h4
element.h4
element stand-aloneI am an
h5
element.h5
element stand-aloneI am an
h6
element.h6
element stand-aloneI am an
h1
element.I am an
h2
element.I am an
h3
element.I am an
h4
element.I am an
h5
element.I am an
h6
element.h1
–h6
combinedI am an
h1
element.I am an
h2
element.I am an
h3
element.I am an
h4
element.I am an
h5
element.I am an
h6
element.h1
–h6
surrounded byp
s - Selector
hgroup
- Examples
-
I am an
h1
element in anhgroup
element.I am a
p
element grouped with that heading.hgroup
withh1
andp
I am an
h2
element in anhgroup
element.I am a
p
element grouped with that heading.hgroup
withh2
andp
I am an
h3
element in anhgroup
element.I am a
p
element grouped with that heading.hgroup
withh3
andp
I am an
h4
element in anhgroup
element.I am a
p
element grouped with that heading.hgroup
withh4
andp
Sectioning Scope Specific Elements
- Selector
header
- Example
-
I am a header
element.header
element stand-alone - Selector
footer
- Example
-
footer
element stand-alone - Selector
address
- Example
-
I am an address
element.address
element stand-alone
Grouping Content
Generic block
- Selector
div
- Example
-
I am a div
element.
div
element stand-alone
Paragraph
- Selector
p
- Examples
-
I am a p
element.
p
element stand-alone
Several p
elements
Thematic break
- Selector
hr
- Examples
-
hr
element stand-alone
hr
element with surounding content
Lists
- Selectors
ul
ul > li
- Example
-
- I am a
list item
in an unordered list.
- I am a list item, too.
- I am a third list.
- I am a nested list item.
- I am a nested list item, too.
- I am a third nested list item.
- I am a nested list item.
- I am a nested list item, too.
- I am a third nested list item.
- I am yet another list item.
ul
element with li
and a
- Selectors
ol
ol > li
- Example
-
- I am a list item in an ordered list.
- I am a list item, too.
- I am a third list .
- I am a nested list item.
- I am a nested list item, too.
- I am a third nested list item.
- I am a nested list item.
- I am a nested list item, too.
- I am a third nested list item.
- I am yet another list item.
ol
element with li
and a
- Selectors
menu
menu > li
menu > li > a
- Example
-
menu
element with li
and a
Definition list
- Selectors
dl
dl > dt
dl > dd
- Example
-
- I am a
dt
element.
- I am a
dd
element.
- I am another
dt
element.
- I am another
dd
element.
dl
element with dt
s and dd
s
Extended quotation
- Selector
blockquote
- Examples
-
I am a blockquote
element.
blockquote
element stand-alone
blockquote.var-alternate
element stand-alone
Nesting blockquote
elements
I am a blockquote
element.
— I am a cite
element inside a p
element.
blockquote
with cite
in an adjacent p
Always build on solid ground!
— Old wisdom
blockquote
inside figure
, followed by figcaption
Self-contained figure
- Selectors
figure
figure > figcaption
- Examples
-
I am a figure
element.
I am a figcaption
element.
figure
element with figcaption
Always build on solid ground!
— Old wisdom
figure.var-feature
with blockquote
Preformatted text
- Selector
pre
- Examples
-
I am a pre
element.
pre
element stand-alone
PPP RRR EEEE
P P R R E
PPP RRR EEE
P R R E
P R R EEEE
pre
element with preformatted content
Text-level Semantics
Generic range
- Selector
span
- Example
-
I am a span
element.
span
element stand-alone
Line Breaks
- Selector
br
- Example
-
I am
broken by a br
element.
Text broken by br
element
- Selector
wbr
- Example
-
Here’s a very long German word:
Donaudampfschifffahrtsgesellschaftskapitänsmützen .
It may wrap at certain places indicated by wbr
elements.
Text broken by wbr
element
Emphasis
- Selector
em
- Example
-
I am an em
element.
em
element stand-alone
- Selector
strong
- Example
-
I am a strong
element.
strong
element stand-alone
Terminology
- Selector
abbr
- Example
-
I am an abbr
element.
abbr
element stand-alone
- Selector
dfn
- Example
-
I am a dfn
element.
dfn
element stand-alone
- Selector
var
- Example
-
I am a var
element.
var
element stand-alone
Inline Quotation
- Selector
q
- Example
-
I am a q
element.
q
element stand-alone
Citation
- Selector
cite
- Example
-
I am a cite
element.
cite
element stand-alone
Altered Baseline
- Selector
sub
- Example
-
I am a sub
element.
sub
element stand-alone
- Selector
sup
- Example
-
I am a sup
element.
sup
element stand-alone
Input/Output
- Selector
kbd
- Example
-
I am a kbd
element.
kbd
element stand-alone
- Selector
samp
- Example
-
I am a samp
element.
samp
element stand-alone
Inline Code
- Selector
code
- Example
-
I am a code
element.
code
element stand-alone
Data
- Selector
data
- Example
-
I am a data
element.
data
element stand-alone
- Selector
time
- Example
-
time
element stand-alone
Enhanced Semantics
- Selector
b
- Example
-
I am a b
element.
b
element stand-alone
- Selector
i
- Example
-
I am an i
element.
i
element stand-alone
- Selector
u
- Example
-
I am a u
element.
u
element stand-alone
- Selector
s
- Example
-
I am a s
element.
s
element stand-alone
- Selector
small
- Example
-
I am a small
element.
small
element stand-alone
- Selector
mark
- Example
-
I am a mark
element.
mark
element stand-alone
Directionality
- Selector
bdi
- Example
-
אני אלמנט bdi
.
bdi
element stand-alone
- Selector
bdo
- Example
-
I am a bdo
element.
bdo
element stand-alone
Ruby
- Selectors
ruby
ruby > rt
ruby > rp
- Example
-
漢
字
ruby
element with rt
wrapped in rp
div
I am a
div
element.div
element stand-alonep
I am a p
element.
p
element stand-alonep
elementshr
hr
element stand-alonehr
element with surounding contentul
ul > li
- I am a list item in an unordered list.
- I am a list item, too.
- I am a third list.
- I am a nested list item.
- I am a nested list item, too.
- I am a third nested list item.
- I am a nested list item.
- I am a nested list item, too.
- I am a third nested list item.
- I am yet another list item.
ul
element with li
and a
ol
ol > li
- I am a list item in an ordered list.
- I am a list item, too.
- I am a third list .
- I am a nested list item.
- I am a nested list item, too.
- I am a third nested list item.
- I am a nested list item.
- I am a nested list item, too.
- I am a third nested list item.
- I am yet another list item.
ol
element with li
and a
menu
menu > li
menu > li > a
menu
element with li
and a
dl
dl > dt
dl > dd
- I am a
dt
element. - I am a
dd
element. - I am another
dt
element. - I am another
dd
element.
dl
element with dt
s and dd
sblockquote
I am a blockquote
element.
blockquote
element stand-aloneblockquote.var-alternate
element stand-aloneblockquote
elementsI am a
blockquote
element.
— I am a cite
element inside a p
element.
blockquote
with cite
in an adjacent p
Always build on solid ground!
blockquote
inside figure
, followed by figcaption
figure
figure > figcaption
figure
element.
figcaption
element.figure
element with figcaption
Always build on solid ground!
figure.var-feature
with blockquote
pre
I am a pre
element.
pre
element stand-alonePPP RRR EEEE P P R R E PPP RRR EEE P R R E P R R EEEE
pre
element with preformatted contentspan
span
element.
span
element stand-alonebr
broken by a
br
element.
br
elementwbr
Here’s a very long German word:
Donauwbr
elements.
wbr
elementem
em
element.
em
element stand-alonestrong
strong
element.
strong
element stand-aloneabbr
abbr
element.
abbr
element stand-alonedfn
dfn
element.
dfn
element stand-alonevar
var
element.
var
element stand-aloneq
I am a q
element.
q
element stand-alonecite
cite
element.
cite
element stand-alonesub
sub
element.
sub
element stand-alonesup
sup
element.
sup
element stand-alonekbd
kbd
element.
kbd
element stand-alonesamp
samp
element.
samp
element stand-alonecode
I am a code
element.
code
element stand-alonedata
data
element.
data
element stand-alonetime
time
element stand-aloneb
b
element.
b
element stand-alonei
i
element.
i
element stand-aloneu
u
element.
u
element stand-alones
s
element.s
element stand-alonesmall
small
element.
small
element stand-alonemark
mark
element.
mark
element stand-alonebdi
bdi
.
bdi
element stand-alonebdo
bdo
element.
bdo
element stand-aloneruby
ruby > rt
ruby > rp
ruby
element with rt
wrapped in rp
Edits
- Selector
del
- Example
-
I am adel
element.del
element stand-alone - Selector
ins
- Example
-
I am an ins
element.ins
element stand-alone
Links
- Selectors
a:any-link
a:any-link:hover
- Example
-
I am an a
(link) element.a
element withhref
attribute stand-alone - Selector
a[id]
- Example
-
I am an a
(anchor) element.a
element withid
attribute stand-alone
Embedding
Multimedia Content
View incomplete examples for
picture
,
source
,
img
,
video
,
audio
,
track
,
map
, and
area
.
- Selector
picture
- Example
-
I am a picture
element.picture
element stand-alone - Selector
source
- Example
-
I am a source
element.source
element stand-alone - Selector
img
- Example
-
I am an
img
element.img
element stand-alone - Selector
video
- Example
-
video
element stand-alone - Selector
audio
- Example
-
audio
element stand-alone - Selector
track
- Example
-
track
element stand-alone - Selector
map
- Example
-
map
element stand-alone - Selector
area
- Example
-
I am an area
element.area
element stand-alone
Embedding Containers
View incomplete examples for
embed
,
iframe
,
object
, and
portal
.
- Selector
embed
- Example
-
embed
element stand-alone - Selector
iframe
- Example
-
iframe
element stand-alone - Selector
object
- Example
-
object
element stand-alone - Selector
portal
- Example
-
I am a portal
element.portal
element stand-alone
Embedded Fragments of Other Markup Languages
View incomplete examples for
svg
and math
.
- Selector
svg
- Example
-
svg
element stand-alone - Selector
math
- Example
-
math
element stand-alone
Tabular Content
- Selectors
table
caption
thead
tbody
tfoot
tr
td
th
col
colgroup
- Examples
-
A B aaa bbb 123 456 Y Z a simple table
Standard Table
What MDN says about table mark-up Element Description <caption>
The <caption>
HTML element specifies the caption (or title) of a table.<col>
The <col>
HTML element defines a column within a table and is used for defining common semantics on all common cells. It is generally found within acolgroup
element.<colgroup>
The <colgroup>
HTML element defines a group of columns within a table.<table>
The <table>
HTML element represents tabular data — that is, information presented in a two-dimensional table comprised of rows and columns of cells containing data.<tbody>
The <tbody>
HTML element encapsulates a set of table rows (tr
elements), indicating that they comprise the body of the table (table
).<td>
The <td>
HTML element defines a cell of a table that contains data. It participates in the table model.<tfoot>
The <tfoot>
HTML element defines a set of rows summarizing the columns of the table.<th>
The <th>
HTML element defines a cell as header of a group of table cells. The exact nature of this group is defined by thescope
andheaders
attributes.<thead>
The <thead>
HTML element defines a set of rows defining the head of the columns of the table.<tr>
The <tr>
HTML element defines a row of cells in a table. The row's cells can then be established using a mix oftd
(data cell) andth
(header cell) elements.a table
about table mark-up
Form-associated Content
View incomplete examples for
form
,
button
,
label
,
fieldset
,
legend
,
datalist
,
option
,
optgroup
,
input
,
textarea
,
select
,
meter
,
output
, and
progress
.
General
- Selector
form
- Example
-
form
element stand-alone - Selector
button
- Example
-
button
element stand-alone
Labeling & Grouping
- Selector
label
- Example
-
label
element stand-alone - Selector
fieldset
- Example
-
fieldset
element stand-alone - Selector
legend
- Example
-
legend
element stand-alone
Value Lists
- Selector
datalist
- Example
-
datalist
element stand-alone - Selector
option
- Example
-
option
element stand-alone - Selector
optgroup
- Example
-
optgroup
element stand-alone
Inputs
- Selector
input
- Example
-
I am an input
element.input
element stand-alone - Selector
textarea
- Example
-
textarea
element stand-alone - Selector
select
- Example
-
select
element stand-alone
Outputs
- Selector
meter
- Example
-
I am a meter
element.meter
element stand-alone - Selector
output
- Example
-
output
element stand-alone - Selector
progress
- Example
-
progress
element stand-alone
Interactive Elements
- Selectors
details
summary
- Example
-
I am a
summary
element.I am a
details
element.details
element withsummary
element - Selector
dialog
- Example
-
a simple dialog
Scripting
View incomplete examples for
script
,
noscript
, and
canvas
.
- Selector
script
- Example
- Nothing to see.
- Selector
noscript
- Example
- Selector
canvas
- Example
-
canvas
element stand-alone