#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    244
    Rep Power
    0

    What's the difference between <ul> and <ol>?


    Hi!

    What is the difference between these two snippets of code?

    <ul>
    <li>...</li>
    <li>...</li>
    <li>...</li>
    </ul>

    and

    <ol>
    <li>...</li>
    <li>...</li>
    <li>...</li>
    </ol>



    I know ul stands for unordered list and ol for ordered list but the two examples above are the same, right?
  2. #2
  3. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1100
    the two examples above are the same, right?
    I guess it depends on your definition of "same." One uses <ul> while the other uses <ol>, so no, they're not the same. But they do both create a list, so that's the same.

    An unordered list uses discs, squares, images, etc as the bullet, and an ordered list uses numbers.

    CSS List Properites
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.
  4. #3
  5. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,128
    Rep Power
    4304
    Semantically they are slightly different. An unordered list indicates that the order of the items doesn't matter, while an ordered list indicates that items are in some kind of significant order.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo