W3C home > Mailing lists > Public > www-style@w3.org > May 2006

[CSS2 counters] Is it possible to evaluate a value inside CSS?

From: Daniel MD <danielmendes@im-thinking.com>
Date: Mon, 15 May 2006 18:39:15 +0100
Message-Id: <7.0.1.0.2.20060515182841.021b5008@im-thinking.com>
To: www-style@w3.org

Hi,

I am trying to do some tricks in CSS, one of them is to use different 
bullet images programmatically using a CSS counter, so i have a 
folder called bullets with 1.gif, 2.gif, etc.... I don't know if it 
is possible to do in CSS, i have tried several ways but i think i am 
not getting the way the list gets created... or perhaps this is not 
possible, what i want to do is for the content: propriety to 
evaluate/return url(1.gif) [see code below]

Using it directly (content:url(1.gif)) works fine... is there a way 
to do this, how do i create a "fake" variable with a counter?

ol {
	counter-reset: list 0;
	list-style:none;	
}
li:before{
	content: url( counter(list,decimal).gif ); //also tried 
url(counter(list,decimal))".gif";
	counter-increment: list;
}

Thanks,
Dan
Received on Monday, 15 May 2006 18:30:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:45 GMT