- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
How do I make CSS class that inherits from another just with small changes in the properties. I have Crunch installed on my system so I can use Less CSS if that is helpful.
Thanks
@Ed, this is NOT the correct way specifying class selectors modifiers using adjoining classes – @jurotek
While I might agree with your method, I don’t agree that it’s the only way to do things. This is not a right/wrong situation, it’s purely personal preference.
my example of modifiers is also modular/interchangable
No it’s not. How would you apply background of red to something other than a box?
Adding namespace to CSS just seems weird and this is the first time I’ve ever heard someone mention namespaces with conjunction to CSS and I’ve been around a while.
@oliversb, look into OOCSS, BEM, and SMACSS. The key to reusable code is abstraction. Follow people like Harry Roberts, Jonathan Snook and Nicole Sullivan. Read their stuff.
Thanks people. I think you know what I trying to do.
How do I do this to apply to specific tags like H3?
How do I do this to apply to specific tags like H3? @oliversb
Simply take @Ed’s first example and replace .box
with h3
and move the h3
to the front of the declaration:
h3.large {
/* styles */
}
Thanks for the quick reply. But this the code which I am using:
<div>
Title Text With Separate Formatting <p>
Some more text.
</p>
</div>
I want to use separate formatting for any code under p tag as it is to the H3 from the same class.
THANKS LOTS