What are the allowed tags inside a <li>?
Solution 1:
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.
Solution 2:
It's a block level element so pretty much anything goes. Trouble only comes when you're putting block level elements inside inline ones.