I am trying to figure all the valid HTML5 elements that can be nested inside paragraph elements such that w3 validator doesn't show any errors. I mean I am trying to figure all tags that can replace the dots in the following code such that w3 validator doesn't show any errors:
<p>...</p>
Is there such a list available? I tried searching on Google without any luck.
Even if the converse list is available, i.e. elements that can not be nested inside paragraph elements, it is good enough for me.
The HTML spec tells us that the <p>
element's content model is phrasing content. Phrasing content is defined by the spec:
3.2.5.2.5 Phrasing content
Phrasing content is the text of the document, as well as elements that mark up that text at the intra-paragraph level. Runs of phrasing content form paragraphs.
a
abbr
area
(if it is a descendant of amap
element)audio
b
bdi
bdo
br
button
canvas
cite
code
data
datalist
del
dfn
em
embed
i
iframe
img
input
ins
kbd
label
link
(if it is allowed in the body)map
mark
- MathML
math
meta
(if theitemprop
attribute is present)meter
noscript
object
output
picture
progress
q
ruby
s
samp
script
select
slot
small
span
strong
sub
sup
- SVG
svg
template
textarea
time
u
var
video
wbr
- autonomous custom elements
- text