tags:

views:

27

answers:

1

I have a div called mycontent. In this div there is a h2 element. This element inherits global properties, but I would like to change its color only within the mycontent div. I would prefer not to add new class because I would like to operate only within the css. I have something like that:

#mycontent {
position: absolute;
bottom: 15px;
left: 10px;


}

#mycontent h2 {
    color: #fff;

}
A: 

Your point being? I mean, you already have the right CSS to achieve what you're asking. The #mycontent h2 {} selector you wrote is right :)

Matteo Mosca
Hmm, that's what I thought as well, but this is not working.
Vafello
If it's not working, it means you have other css selectors that override that and take priority. The declaration "as you wrote it" works just fine. Try with a new html page and a simply css with just those declarations, and you'll see it works.
Matteo Mosca