HTML reference
ul
The <ul> element represents an unordered list. Each direct item should normally be an <li> element.
What you will learn
- How to create an unordered list
- How
ulandliwork together - How
uldiffers fromolandmenu
Basic example
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>The order is not part of the meaning. Browsers may display bullets by default, but CSS controls the visual marker and spacing.
Choose the right list
- Use
ulwhen rearranging the items would not change their meaning. - Use
olwhen sequence or ranking matters. - Use
menufor a list of user actions or commands. - Use
navaround a major navigation group, which can contain a list.
Accessibility tips
Keep each item meaningful and do not remove list semantics just to change the appearance. If a list is only visual decoration, choose markup that matches the content instead.