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.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!