[whatwg] Suggest making <dt> and <dd> valid in <ol>

Leif Halvard Silli xn--mlform-iua at xn--mlform-iua.no
Tue Jul 31 05:14:33 PDT 2012


Ian Hickson on Mon, 16 Jul 2012 04:31:44 +0000 (UTC), wrote:

> It's certainly true that many element names are derived more from 
> historical accidents than their current semantics, but <ol> and <ul> are 
> semantically quite different, as the spec describes.
> 
> Specifically, <ol> implies that the order of the list cannot be changed 
> without affecting the meaning of the page, whereas the order in a <ul> 
> list is merely aesthetic.

Thanks. I learned a lot from this thread.

Just now took myself in writing the following in a Web page: "Regarding 
the last list-item, then …". And then I realized that that "last 
list-item" occurred inside a <ul> list. Which meant that I had to (or 
at least I did) change the list from <ul> to <ol>. I also replaced the 
numerical list-item numbering with circles, to signify that the items 
was not numbered.

In fact, I frequently deal with texts where there is "homework items" 
where each homework item contains one or more sub-items. For these 
sub-items, I use <ol><li>…<li>…</ol> — which seems logical as long as 
there more than one sub-item. But what - at least for the time being - 
there is only one sub-item? I want the sub-item to have a bullet, or 
similar, to signify that it is a sub-item. I don't want a number. At 
the same time, there is no principal difference between that lone 
sub-item and the multiple sub-items in the nearby homework item.

So one option that comes to mind is to do the following, in order to be 
certain that sole-items have a different style:
	ol>li:first-child:last-child {list-style-type:circle}

Should I want to add one item more, then I automatically get numbering.

What strikes me is that I almost never would like to use <ul> anymore. 
Only when I would like to explicitly say that the meaning of this 
document does not change whichever way you list the list-items, only 
then would I pick <ul>.

Which makes me wonder: Why is not value="<number>" allowed for <li> 
inside <ul>? E.g. I might want to add accidental numbers to the 
list-items while at the same time also wanting to say that the page 
does not change meaning whichever way you order the items?

I also wonder: Would it not make sense to advice, when uncertain about 
whether order is significant, advice authors to pick <ol> over <ul>? 
For instance the sub-items of our homework items: Since the order of 
the sub-items often risks becoming significant, it seems smart to pick 
<ol> and not <ul> - even if <ul> sometimes could work too.
-- 
Leif H Silli


More information about the whatwg mailing list