开发者

changing decimal prefix/suffix in numbered lists

Most browsers display order开发者_JAVA技巧ed lists like this:

1. foo
2. bar
3. baz

Is there a way to change the numbering to use a prefix instead:

#1 foo
#2 bar
#3 baz


this is the best I could come up with, only tested in Firefox and Chrome thou

<style>
  #hol-list li {
    list-style-position: inside; 
    list-style-type: decimal;
    position: relative;
  }

  #hol-list li:before {
    content: "\0023";
    position:absolute;
    left: -10px;
  }
</style>

<ol id="hol-list">
<li>first item</li>
  <li>second item</li>
  <li>third item</li>
</ol>


you can use

list-style-type: 
list-style-position: 
list-style-image: 

to control it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜