i have class call "example1" this class defines a background, and i want to create another class call "example2" to uses the same background on each <li> of class called "example1" how can i make it. My goal it’s use the class like this
<ul class="example2">
<li>some text</li>
<li>another text</li>
</ul>
i tried like this
example2, .example1 li{
}
but it doesn’t work
Thansk for your help
UPDATE
I modified the question because my question it not was what i want. I want to use the same background of example1 in each <li> of example 2
You can’t apply the concept of inheritance for CSS classes as we do in OOP. See this question as I think it’s the same thing you want to do. One way to use a single background declaration is:
EDIT: If you are going to use CSS3, then you can use SASS. Good luck with IE for that matter. That’s one navigator I learned to hate over the years.