1

I have this DIV:

<div class="menu">
    <label id="label1">label</label>
    <div id="content">
        content
    </div>
    <a href="" id="link>link</a>
</div>

When I hover the DIV, I only want to change the DIV's font color, not the label's and not the link's.

Thanks in advance.

3
  • Try adding color value to the label and link to override the hover
    – umbriel
    Commented Jul 3, 2013 at 10:29
  • Exactly. I dont quite understand which div you are talking about?
    – user1737842
    Commented Jul 3, 2013 at 10:29
  • the div i wwanted to change was the div id="content" Commented Jul 3, 2013 at 10:54

3 Answers 3

6

Check this fiddle.

CSS:

.menu:hover #content {
    color: red;
}
0
2

I believe you want to add something like this to your css?

div.menu:hover div#content {
    color: red; 
}
0
0

Also if you will have more divs (with other #id) inside the menu and you want that text to respond to the hover you could use:

.menu:hover .menu div {
    color: red;
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.