|
|
 |
Re: FN-FORUM: CSS formatting question with
date posted 30th January 2004 17:03
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
--- Chris Bazalgette [EMAIL REMOVED] wrote:
>
> Following yesterday's questions about CSS and
> and , I was
> wondering about another point with ordered lists.
>
> It can look much better if the numbers in an ordered
> list can be put in
> a different style from the main text: eg different
> colour, bold or
> whatever. I can't see that there's any way of doing
> this, and had to
> fake it using text-indent, as shown below. Does
> anyone know a more
> elegant way?
> Thanks,
> Chris
>
> [Stylesheet:]
>
> p.ref {
> margin-left: 32px;;
> text-indent: -32px;
> margin-top: 3pt;
> margin-bottom: 3pt;
> font-size: 8pt;
> }
>
> span.emph {
> color: #1E50A0;
> font-weight: bold;
> }
>
> [HTML:]
>
> 101.
> Matzkin H, Barak M, Braf
> Z. Effect of finasteride on free and total serum
> prostate-specific
> antigen in men with benign prostatic hyperplasia. Br
> J Urol
> 1996;78:405-408.
>
>
>
>
> --
> ** Get all the Freelance Work you Can Handle *
> The Web Design Business Kit will show you proven
> tactics
> and strategies for marketing your business, winning
> bids,
> managing projects and pricing your work. Free
> Shipping Worldwide.
> Read more & get free chapters at:
> http://www.sitepoint.com/launch/b7c91e/3/4
>
> To advertise here:
> http://www.freelancers.net/advertising.html
>
> Unsub:
>
http://www.freelancers.net/rm.php?g=AD6C8E7BAA002960B67E
>
> To Post a New Message: [EMAIL REMOVED]
> Forum Homepage: http://www.freelancers.net/forum.php
>
> http://www.freelancers.net - freelancers and
> freelance jobs
>
________________________________________________________________________
BT Yahoo! Broadband - Free modem offer, sign up online today and save £80 http://btyahoo.yahoo.co.uk
|
 |
|