Decimal <li> CSS (1.2)
I'm seeing on this site: http://www.modernizr.com/docs/ how they have a decimal list item that actually shows the decimals. I've used firebug and can't seem to determine exactly how it's done. It's gotta be done somehow via CSS... I turned off JS and it still shows up.
Perh开发者_如何学Pythonaps someone else could have better luck...
They're using the counter-increment
and counter-reset
properties. You can use these properties to define sections of your markup that need to be counted incrementally by the browser, and then use them to apply the appropriate labels automatically. (You can see a working demo here.)
Here's a detailed and easy to follow tutorial: CSS Counters: counter-increment and Friends
It's also worth noting that counters don't work below IE8.
精彩评论