开发者

Can I disable the . in an <ol>?

开发者 https://www.devze.com 2023-02-28 14:00 出处:网络
I was delighted to learn that CSS le开发者_运维问答ts me say list-style-type: cjk-ideographic and get my ordered lists numbered 一, 二, 三, 四.Unfortunately, it displays like \"一.\" (2 characters: ka

I was delighted to learn that CSS le开发者_运维问答ts me say list-style-type: cjk-ideographic and get my ordered lists numbered 一, 二, 三, 四. Unfortunately, it displays like "一." (2 characters: kanji/hanzi 1, then ASCII period).

I looked around and found that the CSS spec actually says to do this:

The suffix for the cjk-ideographic numbering systems is a dot . U+002E.

(This seems bizarre, since Japanese doesn't even use U+002E for ending sentences. All of the text I have here uses U+3001 after the number.)

Is there a way to get the automatic "cjk-ideographic" numbering, but have it omit this suffix character, or (better yet) tell it to use U+3001 as the suffix character?


I'm assuming you only want the numbering but not the dot. If that's the case, you can do

ol {
    margin: 0 0 1em 0;  
    counter-reset: item;
}
li:before {
    content: counter(item, cjk-ideographic) " ";
    counter-increment: item;    
}

Check working example at http://jsfiddle.net/davidThomas/82SSG/1/

0

精彩评论

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

关注公众号