Unordered-list
An unordered list is a basic HTML structure used to group related items without implying a specific order. It’s ideal when sequence doesn’t matter—like features, tools, or simple collections.
Why use unordered lists
- Clarity: Groups related points visually and semantically.
- Accessibility: Screen readers announce lists, helping navigation.
- Styling: Easy to customize with CSS for bullets, spacing, and icons.
- SEO: Proper list markup helps search engines understand content structure.
HTML basics
Use the
- element containing
- items:
html
<ul><li>First item</li> <li>Second item</li> <li>Third item</li></ul>
Common uses
- Navigation menus
- Feature lists
- To-do items where order doesn’t matter
- Grouping links or resources
Styling tips
- Remove default bullets: `ul { list-style: none; padding: 0; margin: 0; }
- Use custom icons:
li::markerorli::beforewith background images or SVG. - Control spacing: adjust
marginandpaddingonlielements. - Horizontal lists:
li { display: inline-block; margin-right: 1rem; }
Accessibility considerations
- Keep lists semantically correct—don’t use
in place of lists.
- For complex list items, ensure each
- has clear, concise content.
- If the list is interactive, use proper keyboard focus and ARIA roles when needed.
Examples
- Simple bullet list of features
- Horizontal navigation bar
- Checklist with icons indicating status
An unordered list is a lightweight, semantic building block for grouping non-sequential content; using proper markup and CSS makes it accessible, flexible, and visually effective.
Leave a Reply