Ordered Lists< OL>,从XHTML Strict开始索引? [英] Ordered Lists <OL>, Starting index with XHTML Strict?

查看:106
本文介绍了Ordered Lists< OL>,从XHTML Strict开始索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在遵循XHTML Strict的同时从特定索引开始有序列表?使用start = n很有效,但已被弃用 ......预期目的是恢复带有分页的索引。

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 resume the index with paging.

我看到一些CSS解决方案的参考资料,但起始索引不能像开始时弃用的属性一样使用。 >

I saw a few references to a CSS solution, but the starting index cannot be used like the attribute in the deprecated case of start.

推荐答案

kdgregory 指出,计数器将是实现这一目标并仍然保持有效文档的方式。 关于Array Studio的这篇文章展示了如何在XHTML和CSS中对其进行编码。以下内容是从他们的文章中复制的:

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:

<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>


这篇关于Ordered Lists&lt; OL&gt;,从XHTML Strict开始索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆