Is there a stylesheet language (CSS or not) that implements variables?
Something like this perhaps?
Where each class1 is 10px away from the previous one.Code:var i=0; .class1 { position: absolute; left: ((i++)*10)px; }
Is there a stylesheet language (CSS or not) that implements variables?
Something like this perhaps?
Where each class1 is 10px away from the previous one.Code:var i=0; .class1 { position: absolute; left: ((i++)*10)px; }
You could probably utilize javascript in some way to accomplish this. Also, you could use PHP to create a "dynamic" stylesheet if you really needed to. As for just using CSS, not sure if it is possible (but pretty sure it isn't).
Anyways, hope this helps.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
There are two. One is an actual language, JSSS, which uses Javascript to implement stylesheets. Unfortunately, this existed only in older versions of Netscape, since it never really caught on. The other is IE's expression syntax, which allows one to use JScript to return the value of a property:Unfortunately, neither are universal. CSS3 has some extensions to accomplish a bit more flexibility in stylesheets, but it's still a little confined.Code:.class1 { position: absolute; left: expression( i++ * 10 + "px" ); }
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Well, thanks anyway. Guess I would have to resort to pure JS to do the trick with onloads or something.
Bookmarks