They really should have chosen different names, as when you are first learning about this it is confusing since a visual list is obviously going to be displayed in a certain order. They should have named it something like <bl> (for bullet list) and <nl> (for numbered list).
–
INTPnerdJan 23 at 2:34

Well, technically you can change how the list appears with CSS (list-style). But yes, semanticaly, UL should be used for unordered data and OL for ordered.
–
jimrJun 24 '09 at 17:42

11

Of course the default display is a consideration! Not as important as the semantic meaning of a tag, perhaps, but who wants to spend their time changing OL's to have bullet points, and force every developer after you to figure out your bizarre display rules for standard tags? Pedant fail.
–
Joel MuellerJun 24 '09 at 18:19

4

@Ben Blank: It's not. That's what's semantically important. But if you use an ordered list for unordered data, then use CSS to make the ordered list act like an unordered list, you have failed, hard. That was my point. The semantics is what's important, even if CSS can modify the display. The semantics are what will be used for automated analysis, for example, not the CSS. You think Google is going to parse the CSS to find out if your ordered list is actually an unordered one? Ok, maybe the would, but that's Google. :)
–
RandolphoJun 24 '09 at 18:28

2

@Ben Blank: My only objection was to the idea that the default display should have "no bearing" on your choice. It should not be the primary consideration, but to say that the default display doesn't even enter into the picture implies that you intend to contravene the default display in a way that could confuse later developers.
–
Joel MuellerJun 24 '09 at 18:59

2

Ben, I think we must be talking past each other somehow. If the default manner of display for a given tag is of no interest to me, it's probably because I intend to override the default display. If I don't plan on fiddling with the default display, then what the output is going to look like by default will be one of my considerations, in addition to tag semantics - particularly if more than one tag is a valid choice from a semantic point of view.
–
Joel MuellerJun 24 '09 at 20:55

In math terms (hey, why not?), an <ol> represents a sequence, whereas <ul> represents a set. Rearranging the items in an ordered list changes the list's meaning. Rearranging them in an unordered list does not.

This is a good rule-of-thumb for which type of list to use. If changing the order of the items makes the list incorrect, you want to use <ol>. If the order doesn't matter, use <ul>.

There was no CSS. Beyond these attributes, there wasn't really a way to customize the list formats (and margins and indententations and everything else.) So, this distinction was important.

Nowadays, its all CSS. In fact, the w3 people want you to use styles rather than the html "type" attribute that you used to use. So, using UL vs OL doesn't really matter, if you are one of them newfangled CSS users.

CSS lets you change the bullet type, or opt to use an image, or change the margins/styles/indentations, or not even display a bullet at all.

Edit again: This answer isn't really meant to address the semantic merits of UL vs OL. But technically (you know, at the bits and bytes) the above outlines the differences in behavior.

The correct is to make the distinction because you don't know how the user will reach the information. Maybe his browser doesn't support CSS or he's using a screen reader, or whatever. Semantically they are not the same, so you have to distinguish them.
–
OreJun 24 '09 at 18:33

In some cases (specifically used by Screen Readers for people with special needs) you may want to have ordered list but not have numbers associated with them due to visual design.
Ex. when you've let's say instructions on a page to fill up a form and want screen readers to take advantage of ordered items in the instructions then it will be useful.
For all visual purposes they can be made to look exactly the same through CSS. It's the (non-visual, but helpful to screen reader) semantics that are different and at times useful.