Reputation: 7628
I want on hover on parent, child's child's TEXT ONLY turn red too. Is it possible ?
<div id="row">o
<div id="col" class="col">o o
<div id="colChild" class="col-child">o o o Turn Me Red</div>
</div>
</div>
CSS
#row {
width: 300px;
height:100px;
border: 3px solid red;
}
#row:hover {
background-color:pink
}
#col{
padding:5px;
border: 2px solid blue;
}
#colChild {
padding:5px;
border: 2px solid black;
}
http://jsfiddle.net/NHbn8/235/
Out of Context information In real these are rows of a table and they will also on select keep there hover state (but it's out of context for now)
Upvotes: 1
Views: 102
Reputation: 3429
I am not sure this will work, but I think it would:
<div id="row">o
<div id="col" class="col">o o
<div id="colChild" class="col-child">o o o Turn Me Red</div>
</div>
</div>
Css:
#colChild:hover {
background-color:red;
}
Upvotes: 1
Reputation: 113
You can use css selectors property to apply the effects to any partiticular div. A list of the CSS selectors has been given in the link below.. http://www.w3schools.com/cssref/css_selectors.asp
Upvotes: 0
Reputation: 465
#row {
width: 300px;
height:100px;
border: 3px solid red;
}
#row:hover #colChild{
background-color:red
}
#row:hover {
background-color:pink
}
#col{
padding:5px;
border: 2px solid blue;
}
#colChild {
padding:5px;
border: 2px solid black;
}
Upvotes: 3
Reputation: 6527
Use this on hover parent #row:hover > .col > .col-child{background:red;}
Upvotes: 3