Hope someone can help me with this…
I’ve been trying to work out how to make a parent div change background color to itself AND its children on hover…
Basically the following image shows the normal and hover effects (which is what I have managed to achieve) but what I don’t want is when you hover over just the parent div (in this case .services) the children do not change. (as per the last example)
Any suggestions would be appreciated.
.services {
display: inline-block;
margin:.5em;
vertical-align: top;
width:23%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
-o-box-sizing: border-box;
box-sizing: border-box;
}
.services img {
display: block;
margin: 0 auto;
}
.services h4 {
background-color: #132832;
margin:0;
}
.services h4 a {
color:#FFF;
display: block;
padding: 1em 4.5em 1em 1em;
text-decoration: none;
}
.services h4 a:after {
content: "+";
background-color: #21404f;
display:block;
height: 100%;
position:absolute;
right:0;
top:0;
font-size:200%;
line-height:50px;
text-align:center;
width: 60px;
}
.description {
background-color:#FFF;
display: none;
font-size:95%;
padding:1em;
}
.services:hover {
background-color: #cf4009;
}
.services h4:hover {
background-color: #b43606;
}
.services h4 a:hover:after {
background-color: #dd480e;
}
<div class="services" id="tree-removal"><img src="../images/icon-tree-removal.png">
<h4><a href="#" class="serv1Btn">Tree Removal</a></h4>
<div class="description desc1">
<p>This content toggles up and down when the </p>
</div>
</div>