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
- Selector
article
- Example
- Selector
aside
- Example
- Selector
nav
- Example
Heading Content
- Selectors
h1
,h2
,h3
,h4
,h5
,h6
- Examples
- Selector
hgroup
- Examples
Sectioning Scope Specific Elements
- Selector
header
- Example
- Selector
footer
- Example
- Selector
address
- Example
Grouping Content
Generic block
- Selector
div
- Example
-
Paragraph
- Selector
p
- Examples
-
Thematic break
- Selector
hr
- Examples
-
Lists
- Selectors
ul
ul > li
- Example
-
- Selectors
ol
ol > li
- Example
-
- Selectors
menu
menu > li
menu > li > a
- Example
-
Definition list
- Selectors
dl
dl > dt
dl > dd
- Example
-
Extended quotation
- Selector
blockquote
- Examples
-
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
p
hr
ul
ul > li
ol
ol > li
menu
menu > li
menu > li > a
dl
dl > dt
dl > dd
blockquote
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
-
picture
element stand-alone - Selector
source
- Example
-
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