HTML Question: How to add 0's before the numbers in an Ordered List "<ol>"?
Instead of 1. 2. 3. I want: 01. 02. 03. up to 09. The two digit numbers will of course stay the same. How can this be done?
Public Comments
- <ol> <li>01</li> </ol> You get the idea. -Billy
- if you have only one or two such lists, then try this... <html> <head><title>some title</title> </head> <body> <ol style="list-style-type: decimal-leading-zero"> <li>whatever</li> <li>whatever</li> <li>whatever</li> </ol> </body> </html> if you have several lists and they ALL that need to appear this way, then you can do like so... <html> <head><title>some title</title> <style> ol { list-style-type: decimal-leading-zero } </style> </head> <body> <ol> <li>whatever</li> <li>whatever</li> <li>whatever</li> </ol> <ol> <li>whatever</li> <li>whatever</li> <li>whatever</li> </ol> </body> </html> or, if you have several lists but only some need to appear this way...then you can do so... <html> <head><title>some title</title> <style> ol.doubleDigit { list-style-type: decimal-leading-zero } </style> </head> <body> <ol class="doubleDigit"> <li>whatever</li> <li>whatever</li> <li>whatever</li> </ol> <ol> <li>whatever</li> <li>whatever</li> <li>whatever</li> </ol> </body> </html> not all browsers will support it, though. also...css definitions can be put in a separate file if you need them to be...but that's a subject for a different day.
- Sorry, Jack, but I've never been able to do it. I'm running xp and the CSS stuff just doesn't work for me or FF either. Both Unordered and Ordered are set to do just what they do with the built-in bullets and I've tried many ways to do what you ask but haven't found it yet. You could go with definition list stuff or just build your own, but noway with OL or UL. I do hope someone will answer that does have a way. I'd love to see it.
- Set CSS as: ol li { list-style-type: decimal-leading-zero; } That's it. LOL Ron
Powered by Yahoo! Answers