April 17, 2012
Are there any tricks to set in css inheritance from another object or rule?
Question by anony_root
I’m looking for some trick(s) to make style inherited from another object/class/id. Simple trick: use classes, but are there another ways to specify style of another rule?
Sorry for explanation.. I’m looking for something like:
.st1 {font-size:17pt;} .st2 {-moz/ms/webkit-extends: '.st1';}
?
Actually, I’m not really looking for it (because I use classes), just interested in.
Answer by Starx
Rather than searching for tricks, You are looking for CSS extension libraries like
They do not exactly give a way to do it like you want, but provide even better one. Like
.st1 {font-size:17pt;}
.st2 {
.st1;
}
When the website is launched, these style declarations are compiled and optimized into a valid CSS document.