Can we use any other TAG inside <ul> along with <li>?
According to the W3C Recommendation, the basic structure of a list must be:
<UL>
<LI> ... first list item...
<LI> ... second list item...
...
</UL>
You can put p
tags only inside of li
tags, not as direct children of ul
. The W3C Recommendation expressly states:
lists are made up of sequences of list items defined by the LI element
For your code to be valid you can't put any tag inside a <ul>
other than an <li>
.
You can however, put any block level element inside the <li>
, like so:
<ul>
<li>
<h2>...</h2>
<p>...</p>
<p>...</p>
</li>
</ul>