rob ebster
last year
Robcountry asked

Does <ul> automatically generate bullet points for lists and does <ol> automatically generate numbers for lists?

Abhay Jajodia
Expert
last year
Abhay Jajodia answered

When you use the <ul> tag for unordered lists, the browser automatically adds bullet points (•) to each list item.

And when you use the <ol> tag for ordered lists, the browser automatically numbers the list items in ascending order.

Here's a sample for both:

Unordered List:

<ul>
    <li>Milk</li>
    <li>Bread</li>
    <li>Paper Towels</li>
    <li>Apples</li>
</ul>

This code will display the grocery items with bullet points.

Ordered List:

<ol>
    <li>Milk</li>
    <li>Bread</li>
    <li>Paper Towels</li>
    <li>Apples</li>
</ol>

This code will display the grocery items with numbers (1, 2, 3,...).

Connection to Your Lesson:

You've got the concept down! Just remember that

  • <ul> is used for items that don't need a specific order

  • <ol> is for items that need to be numbered

The <li> tag remains your trusty tool for listing each item.

Hope this clears things up! Let me know if you have more questions or if you’d like to explore further into how you can customize lists. 😊

HTML
This question was asked as part of the Learn HTML course.