有序列表<OL>,使用XHTML Strict开始索引?

cco*_*ook 4 html xhtml-1.0-strict html-lists

有没有办法在遵循XHTML Strict时从特定索引启动有序列表?使用start = n运行良好,但已弃用 ...目的是通过分页恢复索引.

我看到了一些CSS解决方案的引用,但是起始索引不能像不推荐使用的start中的属性那样使用.

Daa*_*aan 8

正如kdgregory所指出的,计数器将是实现此目的的方法,并且仍然保持有效的文档.这篇关于Array Studio的文章展示了如何在XHTML和CSS中编写代码.以下内容是从他们的文章中复制的:

您需要在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;
}
Run Code Online (Sandbox Code Playgroud)

而且,这是您的列表应该如何定义:

<ol id="page_one">
    <li>Division Bell</li>
    <li>Atom Hearth Mother</li>
    <li>Relics</li>
    <li>Dark Side of the Moon</li>
    <li>Wish You Were Here</li>
</ol>

<ol id="page_two">
    <li>The Wall</li>
    <li>More</li>
    <li>Piper at the gates of Dawn</li>
    <li>Final Cut</li>
    <li>Meddle</li>
</ol>
Run Code Online (Sandbox Code Playgroud)