Ordered Lists
    , Starting index with XHTML Strict?

前端 未结 3 504
孤独总比滥情好
孤独总比滥情好 2021-01-03 08:42

Is there a way to start an ordered list from a specific index while following XHTML Strict? Using start=n works well, but has been deprecated… The intended purpose is to r

3条回答
  •  感动是毒
    2021-01-03 09:17

    As kdgregory noted, counters would be the way to accomplish this and still maintain a valid document. This article on Array Studio shows how to code this in XHTML and CSS. The following is copied from their article:

    You need to write the following in your CSS:

    OL#page_one { counter-reset: item }
    OL#page_two { counter-reset: item 5 }
    LI { display: block }
    LI:before {
        content: counter(item) ". ";
        counter-increment: item;
        display:block;
    }
    

    And, this is how your lists should be defined:

    1. Division Bell
    2. Atom Hearth Mother
    3. Relics
    4. Dark Side of the Moon
    5. Wish You Were Here
    1. The Wall
    2. More
    3. Piper at the gates of Dawn
    4. Final Cut
    5. Meddle

提交回复
热议问题