<ol>
<li>test</li>
<li>test</li>
</ol>
将显示为:
- 测试
- 测试
我想要数字彩色和黑色文本!
我可以编辑 css,但我无权访问 HTML。
最佳答案
CSS spec给出了一个这样做的例子。不幸的是,虽然它适用于 Firefox 3,但它似乎不适用于 IE7:
<html>
<head>
<style>
ol { counter-reset: item; }
ol li { display: block; }
ol li:before {
content: counter(item) ". ";
counter-increment: item;
color: red;
}
</style>
</head>
<body>
<ol>
<li>item</li>
<li>item</li>
<li>item</li>
</ol>
</body>
</html>
关于html - <ol> 数字另一种颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/488830/