Using vbscript within a css page

komrad's picture

He has: 3 posts

Joined: Jul 2008

Hello all,

I'd like to know if it's ok to use vbscript within a css page?
I'm thinking about defining certain variables at the beginning of the style sheet so that it's easy to change between colors (or load the colors from a database so each user can have their own custom colors). I know it's possible and it works but does it go against the w3c standard?

Thanks.

[URL="http://www.website.ws/freedombucks"][B][COLOR="Blue"]Global Domain International - Income For Life[/COLOR][/B][/URL]
[URL="http://www.ultra-internet-income.com"][COLOR="Green"][B]#1 Home Based Business Site[/B][/COLOR][/URL]
[URL="http://www.theSpiderWebSystem.com/komrad"][COLOR="Violet"][B]Spider Web Marketing System[/B][/COLOR][/URL]

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

I'd like to know if it's ok to use vbscript within a css page?

Is this client-side or server-side vbscript? I believe client-side will only work with Internet Explorer/Windows. You could try running the CSS file through the W3C Validator, but I expect it will cause errors (uness it's server-side vbscript, in which case you should be fine).

Welcome to the forums! Smiling

a Padded Cell our articles site!

He has: 629 posts

Joined: May 2007

Hi Komrad,

Does this article help? "CSS Constants" by Christian Heilmann.

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

Interesting article, webwiz, but I don't see how it applies to the OP question about vbscript...

Also, Komrad, I'm not sure what you mean by a "css page"? We might have an HTML or PHP or ASP page that may include a css stylesheet file for formatting.

I do not think it is possible to use any vbscript within a css stylesheet.

webwiz's article demonstrates how to define css property constants as PHP variables then write them to the style definition using PHP - rather than using the vars as constants (I can't imagine why this would be desirable?) this technique actually makes the DOM dynamic (able to change at the time of loading) without javascript/DHTML... but I do not think the styles can be changed with the PHP constants after the page has loaded.

Back to Komrad's question, if you are speaking of using vbscript within a web page that also uses css (either inline, embedded, or external), I do not see why not....

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.