所以我一直在搜索高低,并且无法找到一个看似简单问题的答案.
<ol> <li>Some text here</li> <li>Some more text here..</li> <li>Oh yeah,here's some pretty text</li> </ol>
哪个显示:
- Some text here
- Some more text here..
- Oh yeah,here’s some pretty text
我想要真正展示的内容:
Step 1. Some text here
Step 2. Some more text here..
Step 3. Oh yeah,here’s some pretty text
问题:这是否可行,如果是这样,如何在不使用可疑解决方案的情况下进行此操作?
解决方法
你可以使用:: before(:IE8之前)和counter-reset / increment
ol { counter-reset: number; } li { list-style: none; counter-increment: number; } li::before { content: "Step " counter(number) "."; position: relative; left:-5px }
<ol> <li>Some text here</li> <li>Some more text here..</li> <li>Oh yeah,here's some pretty text</li> </ol>
原文地址:https://www.jb51.cc/html/231916.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。