|
|
 |
Re: FN-FORUM: CSS formatting question with
date posted 30th January 2004 20:55
Thanks, Mike - two different approaches, neither of which I knew could
be done. Learn something new every day.
Chris
In message [EMAIL REMOVED] Michael Lang
[EMAIL REMOVED] writes
>
>You should be able to use:
>
>OL { counter-reset: item }
>LI { display: block }
>LI:before {
> content: counter(item, "..");
> counter-increment: item;
>}
>
>Alas, as of yet no browser seems to support counter,
>counter-increment and counter-reset CSS2 properties.
>
>So on the other hand you could do it with a
>javascript:
>In your css:
>
>html[xmlns] ol {list-style-type: none;} //mozilla
>ol {behavior: url("li.htc");}
>
>Then in your javascript:
>
>function numberlist{
>element.style.listStyleType = 'none';
>oM = element.childNodes.length;
>for ( i = 0; i < oM; i++ ) {
> oLI = element.childNodes[i];
> oLI.innerHTML = '' + (i+1) + '. ' +
>oLI.innerHTML;
>}
>}
>
>and hey presto you have your numbered list. Although
>I'm not sure if this is elegant enough for you.
>
>Mike
>thebasement.madsims.net
|
 |
|