An ul
may only contain li
elements (and script
/template
elements, but they are irrelevant for this question).
Using an additional li
for the separator doesn’t seem to be appropriate because a separator is hardly a "list item".
If a list can be split into several groups (or, well, lists), I’d go with using several ul
elements, optionally with headings.
<h1>Our menu</h1>
<h2>Meat</h2>
<ul>
<li>Duck ala orangé</li>
<li>Chicken ala Banana</li>
<li>Beef</li>
</ul>
<h2>Dessert</h2>
<ul>
<li>Chocolate mousse</li>
<li>Wafer thin mints</li>
</ul>
Thanks to the headings, this allows user-agents (e.g., screen readers with outline access) to jump directly to a list of interest.
If you don’t want to provide explicit headings, you could use section
so that there are still outline entries (unlabeled, though) (and/or visually hide the headings):
<h1>Our menu</h1>
<section>
<ul>
<li>Duck ala orangé</li>
<li>Chicken ala Banana</li>
<li>Beef</li>
</ul>
</section>
<section>
<ul>
<li>Chocolate mousse</li>
<li>Wafer thin mints</li>
</ul>
</section>
It would certainly be possible to use only one list (as suggested by Oriol):
<h1>Our menu</h1>
<ul>
<li>
<ul>
<li>Duck ala orangé</li>
<li>Chicken ala Banana</li>
<li>Beef</li>
</ul>
</li>
<li>
<ul>
<li>Chocolate mousse</li>
<li>Wafer thin mints</li>
</ul>
</li>
</ul>
But personally I don’t find it elegant to have those unlabeled top-level li
.
If you can use headings, you should definitely use explicit section
elements (otherwise the heading scope includes the beginning of the next list item):
<h1>Our menu</h1>
<ul>
<li>
<section>
<h2>Meat</h2>
<ul>
<li>Duck ala orangé</li>
<li>Chicken ala Banana</li>
<li>Beef</li>
</ul>
</section>
</li>
<li>
<section>
<h2>Dessert</h2>
<ul>
<li>Chocolate mousse</li>
<li>Wafer thin mints</li>
</ul>
</section>
</li>
</ul>
But why? This gives you a list of categories on the first level (while the actual items are on the second level). But is this useful? Probably depends on the context, but generally I’d prefer to use headings/sections (for each category) + separate lists.
It’s probably mostly personal taste.