开发者

changing decimal prefix/suffix in numbered lists

开发者 https://www.devze.com 2022-12-29 13:51 出处:网络
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:

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

精彩评论

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

关注公众号