![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
In most programming languages, one can define a value and then uses that value by referencing the name in all of the source, |
|
Is there something like that in CSS and I missed it somehow, or is such functionality non-existant in CSS? |
#3
| |||
| |||
|
|
I couldn't find this anywhere so I'm not sure that it exists. In most programming languages, one can define a value and then uses that value by referencing the name in all of the source, and if that value needs to be changed, then it's a simple matter of changing the definition, and the change will be reflected of course throughout the whole thing. [SNIP] Is there something like that in CSS and I missed it somehow, or is such functionality non-existant in CSS? |
#4
| |||
| |||
|
|
In most programming languages, one can define a value and then uses that value by referencing the name in all of the source, and if that value needs to be changed, then it's a simple matter of changing the definition, and the change will be reflected of course throughout the whole thing. |
#5
| |||
| |||
|
|
I couldn't find this anywhere so I'm not sure that it exists. In most programming languages, one can define a value and then uses that value by referencing the name in all of the source, and if that value needs to be changed, then it's a simple matter of changing the definition, and the change will be reflected of course throughout the whole thing. This could come in very handy in creating similar stylesheets to create various schemes. |
#6
| |||
| |||
|
|
For common variables across different stylesheets, having something generate your CSS for you would be the best solution. For common things within a single stylesheet, you can write your stylesheets in a different manner. e.g. Put common stuff at the start: p, td, div {color:red; background-color:white;} h1, h2, th {color:blue: background-color:yellow;} Then continue to define the individual stuff, later: p {margin:auto; max-width: 55em;} div {border: thin solid black;} th {padding: 0.3em;} |
![]() |
| Thread Tools | |
| Display Modes | |
| |