/    Sign up×
Community /Pin to ProfileBookmark

variables within css?

Can style sheets accept variables?
I wanted to change the following using variables but doesnt seem to work for frames…

body { margin: 0; overflow: hidden;}
#top { height: 15%; width: 100%; overflow: hidden; border: 0;}
#bottom { height: 85%; width: 100%; overflow: auto; border: 0;}

using variable1 and variable2

body { margin: 0; overflow: hidden;}
#top { height: variable1%; width: 100%; overflow: hidden; border: 0;}
#bottom { height: variable2%; width: 100%; overflow: auto; border: 0;}

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@FangAug 31.2005 — Only in IE using [URL=http://msdn.microsoft.com/workshop/author/dhtml/overview/recalc.asp]expression[/URL]
Copy linkTweet thisAlerts:
@the_treeAug 31.2005 — Although I don't see why you'd want to, it could be easily achived server-side.

Very very simple PHP script:[code=php]<?php
header('content-type:text/css; charset=iso-8859-1');
header('Pragma: no-cache');

echo <<< STYLE

body{
background: #{$back};
color: #{$forth};
}

STYLE;

?>[/code]
Copy linkTweet thisAlerts:
@CharlesAug 31.2005 — Not with CSS but XHTML does support creating your own entities. So you couldn't do that with an external style sheet.
×

Success!

Help @ranosb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.12,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...