Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What child elements are valid inside of a <li>? [duplicate]

Tags:

html

css

Say I have

<li></li>

What are the rules when putting other tags inside of these? For instance

<li>Hello. <p>I am a paragraph</p></li>

or

<li>Hello. <span>I am a span</span></li>

What should be taken into consideration when doing this?

like image 761
stevenmw Avatar asked Jul 28 '13 03:07

stevenmw


1 Answers

Both <p> & <span> are flow content, which is permitted as the child of an <li>, which means both are equally valid in HTML5.

like image 134
Andrew Marshall Avatar answered Nov 15 '22 09:11

Andrew Marshall