如何删除点“。”在OL中的有序列表项中的号码后? [英] How to remove dot "." after number in ordered list items in OL LI?
本文介绍了如何删除点“。”在OL中的有序列表项中的号码后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
HTML + CSS:没有句点的有序列表?
$ b b
想要删除点。从OL(订单列表)
< ol>
< li>一个< / li>
< li>两个< / li>
< / ol>
结果
1.一个
2.两个
所需结果
1一个
2两个
<
ol {
counter-reset:item;
list-style-type:none;
}
li {display:block; }
li:before {
content:counter(item);
counter-increment:item
}
或甚至:
ol li:before {
content:counter(level1); / *而不是。* /
counter-increment:level1;
}
如果你想支持旧的浏览器, courtesy neemzy):
ol li a {
float:right;
margin:8px 0px 0px -13px; / *崩溃< a>和点* /
padding-left:10px; / *返回数字和文本开头之间的一些空格* /
position:relative; z指数:10; / *使< a>出现上面的点* /
background-color:#333333; / *与ol相同的背景颜色;这些点现在是隐形的! * /
}
Possible Duplicate:
HTML + CSS: Ordered List without the Period?
Want to remove dot "." from OL (order list)
<ol>
<li>One</li>
<li>Two</li>
</ol>
Result
1. One
2. Two
Required Result
1 One
2 Two
解决方案
This will work in IE8+ and other browsers
ol {
counter-reset: item;
list-style-type: none;
}
li { display: block; }
li:before {
content: counter(item) " ";
counter-increment: item
}
or even:
ol li:before {
content: counter(level1) " "; /*Instead of ". " */
counter-increment: level1;
}
If you want older browsers to be supported as well then you could do this (courtesy neemzy):
ol li a {
float: right;
margin: 8px 0px 0px -13px; /* collapses <a> and dots */
padding-left: 10px; /* gives back some space between digit and text beginning */
position: relative; z-index: 10; /* make the <a> appear ABOVE the dots */
background-color: #333333; /* same background color as ol ; the dots are now invisible ! */
}
这篇关于如何删除点“。”在OL中的有序列表项中的号码后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文