ul
An unordered list where sequence is not important.
Learn ul, ol, li, dl as part of the HTML element system: when to use it, how it fits inside a document and what mistakes to avoid.
Lists
Lists are for grouped items. Use unordered lists when order does not matter, ordered lists when sequence matters and description lists for term-description pairs.
Navigation menus, feature lists, steps, definitions and checklists are all better when the list structure is real HTML.
ul, ol, li, dl. Grouped items, ordered steps and term-description pairs. Syntax in context
If changing the order changes the meaning, use ol. If it does not, use ul. If each item has a term and explanation, use dl.
<ol> <li>Create the HTML file.</li> <li>Add the document structure.</li> <li>Open it in the browser.</li> </ol> <dl> <dt>HTML</dt> <dd>Structure of the page.</dd> </dl>
Good versus weak
<ol> <li>Create the HTML file.</li> <li>Add the document structure.</li> <li>Open it in the browser.</li> </ol> <dl> <dt>HTML</dt> <dd>Structure of the page.</dd> </dl>
1. Create the HTML file<br> 2. Add the document structure<br> 3. Open it in the browser<br>
HTML quick reference
Use these patterns when you need the syntax quickly. Each example has its own anchor, so search engines and readers can land directly on the exact pattern instead of only at the top of the lesson.
A clean version of the markup from this lesson. Use it when you need the correct HTML shape quickly.
<ol> <li>Create the HTML file.</li> <li>Add the document structure.</li> <li>Open it in the browser.</li> </ol> <dl> <dt>HTML</dt> <dd>Structure of the page.</dd> </dl>
Meaningful markup that stays understandable before CSS and JavaScript are added.
The starting point from the practice lab. Change the HTML first, then use CSS only for presentation.
<section class="demo-card"> <h1>Launch checklist</h1> <ol> <li>Write semantic HTML.</li> <li>Add responsive CSS.</li> <li>Test in the browser.</li> </ol> </section>
A complete practice snippet that shows how the HTML behaves in context.
A weak pattern from the lesson. Use it as a warning sign when reviewing real pages.
1. Create the HTML file<br> 2. Add the document structure<br> 3. Open it in the browser<br>
A recognizable mistake you can search for and refactor.
Rules that matter
ul and ol should contain li elements as direct list items.
Use ol for instructions, rankings and numbered processes.
Navigation links are often a list of related destinations.
Use dl for glossaries, metadata and FAQ-like term pairs.
Production thinking
Beginners often ask why this is not just a div with styling. The reason is that HTML is read by browsers, search engines, screen readers and future developers. Clear meaning makes the page easier to use and maintain.
Real lists announce item counts and list structure, which makes scanning easier for assistive technology users.
List markup is ideal for nav menus, pricing features, documentation steps, filters and structured content blocks.
Live code lab
Edit the HTML or CSS, then use Run to refresh the preview. The preview is isolated, so links and forms stay inside this practice area.
Mini assignment
Practice assignment
Try it yourself
Self-check
Do not only read this page. Answer these questions out loud or write the answers in your own notes. If one answer feels vague, revisit the examples before moving on.