What are the allowed tags inside a <li>?

petsagouris picture petsagouris · Feb 11, 2011 · Viewed 70.5k times · Source

I have been searching for the list of tags that are available inside a <li>, but I couldn't find any reference.

Is it possible that any standards-compliant HTML 4+ block element is allowed in them?

Answer

RoToRa picture RoToRa · Feb 11, 2011

TL;DR: an <li> can contain any element that is valid in <body>.

In the HTML 4.01 spec for lists you’ll find the relevant extract of the DTD:

<!ELEMENT LI - O (%flow;)* -- list item -->

This specifies that an <li> may contain flow content, which is the collection of all block and inline elements.

The HTML5 spec for an <li> is the same in that it also allows any flow content.