3

The HTML 4 spec treats the following as a deprecated example (search for "DEPRECATED EXAMPLE"):

<UL>
     <LI> ... Level one, number one...
     <OL> 
        <LI> ... Level two, number one...
        <LI> ... Level two, number two...
        <OL start="10"> 
           <LI> ... Level three, number one...
        </OL> 
        <LI> ... Level two, number three...
     </OL> 
     <LI> ... Level one, number two...
</UL>

Why is this example deprecated?

ezequiel-garzon
  • 3,047
  • 6
  • 29
  • 33
  • 2
    My guess is that the example is deprecated because one of the `
      ` includes the deprecated `start` attribute.
    – jmoerdyk Aug 25 '14 at 21:31

2 Answers2

6

The spec details the proper way to nest ul and ol elements. They must be encased in an li element, as follows:

<ul>
    <li>
       <ol>
          <li>Hello there</li>
       </ol>
    </li>
</ul>

However in your example, the lists are not wrapped in an li tag, meaning that it would fail HTML validation.

christopher
  • 26,815
  • 5
  • 55
  • 89
  • The lists **are** wrapped in an `li`. The indenting is just bad and it is taking advantage of the rule that end tags for `li` elements are optional. – Quentin Aug 25 '14 at 21:34
  • Thanks for your answer, chrisopher. I believe the linked document is a wiki more than a spec, and in any case `OL` is inside the first `LI`. It would be great if the specs included a clarifying note... – ezequiel-garzon Aug 25 '14 at 21:53
  • I was tempted to fix the indenting, but after all that is how it is presented in the spec. – ezequiel-garzon Aug 25 '14 at 21:56
6

The start attribute is deprecated in HTML 4 (it is un-deprecated in HTML 5). Everything else about the example is fine.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • I found the other answers very informative, but I believe you're right, so here goes my humble green check mark. It's puzzling how elements and attributes become deprecated and later "pardoned"! – ezequiel-garzon Aug 25 '14 at 21:48
  • 1
    HTML 4 attempted to design a clean specification that neatly separated concerns. HTML 5 gave up on that after people learned HTML from awful tutorials and mostly just documented what people were actually writing. – Quentin Aug 25 '14 at 21:52
  • I could see how what you say applies to the readmitted `U` and `S` elements, but why would you deprecate the `start` attribute? It seems to be useful, if somewhat redundant when `LI`s have `value` attributes. EDIT: Wait! The also deprecated `value` for `LI`s in the same sapec! Go figure... – ezequiel-garzon Aug 25 '14 at 22:02
  • 1
    @eze — Replaced by CSS counters. – Quentin Aug 25 '14 at 22:05
  • Thanks, Quentin. I didn't know about those! I still feel the `start` attribute is more content than presentation, unlike the clearly historical `type` attribute for `OL`. – ezequiel-garzon Aug 25 '14 at 22:33