在编造文件时,我用在定购清单中的定购清单绘制了大纲,并采用了使用CSS的假冒法律式浏览。 清单的缺省行为是正确的数字,留下了统一的案文;然而,CSS2利用这一方法,正在改变这种行为,使数字不相称,案文不正确,而左翼流则不正确。 见以下例子:
过失行为(第10号报告强调了所期望的趋同):
1. Item
2. Item
1. Item
2. Item
1. Item
2. Item
3. Item
...
10. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nunc et diam sem. Pellentesque vitae dolor id eros commodo
dapibus tristique sit amet eros. Pellentesque turpis turpis.
Styled behavior (Number 10 highlights the undesirable alignments):
Using a derived CSS2 snippet from http://www.w3.org/TR/CSS2/generate.html
OL { counter-reset: item }
LI { display: block }
LI:before { content: "("counters(item, ".") ") "; counter-increment: item }
成果:
(1) Item
(2) Item
(2.1) Item
(2.2) Item
(2.2.1) Item
(2.2.2) Item
(3) Item
...
(10) Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nunc et diam sem. Pellentesque vitae dolor id eros commodo
dapibus tristique sit amet eros. Pellentesque turpis turpis.
页: 1 Li{显示:栏目<>/代码>正在压制缺省编号和LI:
预先确定具有反值的“正常”文本。 我如何能够有法律型编号,并期望数字和案文的一致?
The following a full document show the issue:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Outline</title>
<style type="text/css">
ol {
counter-reset: item;
list-style-position: outside
}
li {
display: block;
padding-left: 10px;
}
li:before {
content: "("counters(item, ".") ") ";
counter-increment: item
}
</style>
</head>
<body>
<h1>Outline</h1>
<ol>
<li>Item</li>
<li>Item
<ol>
<li>Item</li>
<li>Item
<ol>
<li>Item</li>
<li>Item</li>
</ol>
</li>
</ol>
</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nunc et diam sem. Pellentesque vitae dolor id eros commodo
dapibus tristique sit amet eros. Pellentesque turpis turpis.</li>
</ol>
</body>
</html>