An li inside an ordered list can use value to set the number for that entry. Following entries generally continue from that number.
What You Need to Know
This can be useful for excerpts from a long procedure, but unexpected jumps may confuse readers who think a step is missing.
The goal is not to collect as many tags as possible. Pick the element that best describes what the content really is.
Example: See It in Action
Take a look at this small piece of HTML. You can use it in a practice document and change the text to make it your own.
This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.
<ol>
<li>Introduction</li>
<li value="5">Advanced lesson</li>
<li>Next chapter</li>
</ol>
Let’s Understand the Example
- Li is one item inside a list. Keep each item inside its parent list.
- Ol groups items whose order or numbering matters.
- Value is the value represented or submitted by a control or data element.
You should see distinct list items. Ask whether their order carries meaning: if the order matters, use an ordered list; otherwise use an unordered list.
What Should You See?
The page should include “Introduction”. If it looks different from what you expected, open developer tools and compare the source with the elements the browser created.
Try removing one piece of markup in a scratch copy, refresh the page, and compare the behavior. This is often the fastest way to understand what that piece contributes.
Try It Yourself
- Change the jump from 5 to 10 and observe the next number.
- Save your changes, open or refresh the page, and compare the result with the original example.
- Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.
Common Beginner Mistakes
- Using value to make a list look decorative when the numbering carries meaning.
- Avoid picking tags just for their default bold, italic or spaced appearance. Use CSS for presentation.
Key Takeaways
- An li inside an ordered list can use value to set the number for that entry.
- Li is one item inside a list. Keep each item inside its parent list.
- This can be useful for excerpts from a long procedure, but unexpected jumps may confuse readers who think a step is missing.