Arda
Arda

Reputation: 10919

What are the acceptable tags within heading tags?

Which HTML elements are acceptable by modern browsers like Chrome, Firefox, Edge inside heading tags h1, h2, h3, h4, h5, h6?

For example <h2><div></div></h2> may not be acceptable but <h2><i></i></h2> may be valid. Can you please list, to the best of your ability, the known HTML elements that would be valid?

I'm especially looking for something that can take an image inside. (<img/> tag?)

Upvotes: 0

Views: 26

Answers (1)

Rob
Rob

Reputation: 15160

This is a very broad question but a list already exists. With such questions, always consult the spec.

Heading Content

Heading content defines the header of a section (whether explicitly marked up using sectioning content elements, or implied by the heading content itself).

Palpable Content

As a general rule, elements whose content model allows any flow content or phrasing content should have at least one node in its contents that is palpable content and that does not have the hidden attribute specified.

Upvotes: 1

Related Questions