可能重复:
HTML + CSS:没有句点的有序列表?
想要删除点"." 来自OL(订单)
<ol>
<li>One</li>
<li>Two</li>
</ol>
Run Code Online (Sandbox Code Playgroud)
结果
1. One
2. Two
Run Code Online (Sandbox Code Playgroud)
要求的结果
1 One
2 Two
Run Code Online (Sandbox Code Playgroud)
Moi*_*man 26
这将适用于IE8 +和其他浏览器
ol {
counter-reset: item;
list-style-type: none;
}
li { display: block; }
li:before {
content: counter(item) " ";
counter-increment: item
}
Run Code Online (Sandbox Code Playgroud)
甚至:
ol li:before {
content: counter(level1) " "; /*Instead of ". " */
counter-increment: level1;
}
Run Code Online (Sandbox Code Playgroud)
如果你想要支持旧的浏览器那么你可以这样做(礼貌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 ! */
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
23175 次 |
| 最近记录: |