This is a discussion on "Looking for something like a C-style macro" within the Web Page Design section. This forum, and the thread "Looking for something like a C-style macro are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Looking for something like a C-style macro
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Looking for something like a C-style macro
Hi, I just started using CSS. I would like to experiment with colors and fonts, so I'm looking for an easy way to make global changes.
I'd like to be able to define several colors and several fonts the way you do #define macros in C - you know #define UPPER 500 #define LOWER 0 - Is there a way to make say, color1 (gets) #330000, color2 (gets) #6699aa etc so that I can put color1 in all the properties i want to have that color, and just change the color where it is defined. (I'd also like to be able to do this for fonts, family & size.) thank you LN |
|
|
|
||||
|
Re: Looking for something like a C-style macro
|
|
|||
|
Re: Looking for something like a C-style macro
Hi, thanks for that link. This was one of the tutorials I used, but I didn't see anything that seemed to me to fit the description of what I was looking for.
I thought that the id Selector was close, but it didn't seem to be saying "this works like a macro" & it didn't say how I should use it. Is this what you were pointing me to? Do you have any additional information on how to use this? thanks |
|
|||
|
Re: Looking for something like a C-style macro
Forget the macro concept. There is no such thing but CSS does exactly want you want it to do when you know how to use it. Basic styling options: 1. Styling tags, e.g.
2. Class styles, e.g.
With this, in any tag in your code you can add the class and that style will be applied, e.g.
But of course you wouldn't expect it to be that simple would you? There is also the rule of specificity. This means that the more specific you make a definition, the greater precedence it will have where definitions clash. E.g.
Hope this helps you to understand. Last edited by ukgeoff; Aug 19th, 2006 at 17:29. |
![]() |
| Tags |
| cstyle, macro |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| My navigation style | TheSealPortalTeam | Graphics and 3D | 12 | Jan 23rd, 2008 17:30 |
| style | MetallicWarfare | Starting Out | 12 | Aug 13th, 2007 09:00 |
| web style | littlebilly | Website Planning | 7 | Jul 22nd, 2007 14:58 |
| How to tell IE7 to use a pariticular style in a single style sheet | figo2476 | Web Page Design | 5 | May 25th, 2007 14:23 |
| Just for style? | timmytots | Web Page Design | 4 | Nov 17th, 2005 21:01 |