html - Can I Specify Variable Names In A CSS File -
i in process of adding background images couple of hundred web pages. app doesn't know until runtime image load. have been able work fine changing statement in of pages contain attributes need plus variables image file name, etc:
<body style="margin:0; background-image: url(<%= strbackgroundimage %>); background-repeat: <%= strbackgroundrepeat %>">
while above statement works, rather put attribute info css file this:
body { margin:0; background-image: url(<%= strbackgroundimage %>); background-repeat: <%= strbackgroundrepeat %>; }
but doesn't work. attributes containing variable names ignored. how can modify above snippet work in css file , still allow me set variables' contents in code behind files?
thanks.
in short
no cannot pass variables in css.
sass or scss
sass , scss support variables.
less
less supports variables too
Comments
Post a Comment