Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I disable the . in an <ol>?

Tags:

css

html-lists

I was delighted to learn that CSS lets 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?

like image 209
Ken Avatar asked Apr 23 '11 23:04

Ken


1 Answers

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/

like image 76
Hussein Avatar answered Jan 05 '23 03:01

Hussein