Me too - I'd love to see support for variables too, so that you could change all the colours in the site by changing the values of a couple of variables.d11wtq wrote:I've been wondering this although I've never looked into it. I've often thought it would be useful if I could have 25% width less 4 pixels or something.Hockey wrote:Does anyone know if CSS has any future plans to support calculations on it's values...
CSS
Moderator: General Moderators
GM wrote:Me too - I'd love to see support for variables too, so that you could change all the colours in the site by changing the values of a couple of variables.
Code: Select all
h1 { font-family: verdana; }
.class1 { float: left; width: 50%; font-weight: bold; }
.class2 { float: right; width: 100%; text-decoration: none; }
.class3 { text-decoration: underline; clear: both; }
h1, .class1, class2, .class3 { color: #FF8800; }Thanks onion2k - it's a neat way of doing it, but I meant something along the lines of:
from a readability point of view, it's nicer.
Code: Select all
var $light_background = #DDDDDD;
var $light_shadow = #999999;
.class1 {
color: $light_background;
border-left: $light_shadow;
...
}- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- Bill H
- DevNet Resident
- Posts: 1136
- Joined: Sat Jun 01, 2002 10:16 am
- Location: San Diego CA
- Contact:
That doesn't sound hacky at all to me. It sounds brilliant.
I've been doing it for some time. Thought it was brilliant when I read it in a DevNetwork Forum post and adopted it as my standard practice. Actually, I use three style sheets, formatting, font and color. When I class my elements I then combine the three classes in the definition.
Makes site changes simple and easy, and it makes the design process easier for me because the three sheets means fewer definitions overall. Less to remember when I'm coding and, unless I'm mistaken, less for the viewer's browser to cache.
I've been doing it for some time. Thought it was brilliant when I read it in a DevNetwork Forum post and adopted it as my standard practice. Actually, I use three style sheets, formatting, font and color. When I class my elements I then combine the three classes in the definition.
Makes site changes simple and easy, and it makes the design process easier for me because the three sheets means fewer definitions overall. Less to remember when I'm coding and, unless I'm mistaken, less for the viewer's browser to cache.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- Bill H
- DevNet Resident
- Posts: 1136
- Joined: Sat Jun 01, 2002 10:16 am
- Location: San Diego CA
- Contact:
Actually, it was this Forum that finally made a "CSS believer" out of me.
I found it unwieldy and difficult at first, I'm an "old dog" and 63 years of age, but the people on this forum led me to an understanding of the process that now has me convinced that designing web pages would be unbelievably difficult without CSS.
I'm no preacher. If you want to use tables I'm perfectly happy to let you do so. But other than for tabular data, I have found layout with CSS to be just a whole lot easier and faster. And more fun.

I found it unwieldy and difficult at first, I'm an "old dog" and 63 years of age, but the people on this forum led me to an understanding of the process that now has me convinced that designing web pages would be unbelievably difficult without CSS.
I'm no preacher. If you want to use tables I'm perfectly happy to let you do so. But other than for tabular data, I have found layout with CSS to be just a whole lot easier and faster. And more fun.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Very well said. I am "half an old dog" at almost 32, but I was in the same boat. Then, once I got the hang of it, and once I learned that there are some pretty neat features of table design FOR TABULAR DATA, I never thought about developing a layout with a table again. Now the hard part is going back to what I have done and making it's code prettyBill H wrote:Actually, it was this Forum that finally made a "CSS believer" out of me.
I found it unwieldy and difficult at first, I'm an "old dog" and 63 years of age, but the people on this forum led me to an understanding of the process that now has me convinced that designing web pages would be unbelievably difficult without CSS.
I'm no preacher. If you want to use tables I'm perfectly happy to let you do so. But other than for tabular data, I have found layout with CSS to be just a whole lot easier and faster. And more fun.