You cannot manipulate an object that does not have a hierarchical level. You can use this method:
<div class="icons">
<div class="first">
<div class="outer-box"> </div>
</div>
</div>
.first:hover .outer-box{
}
Or you can use javascript:
document.getElementsByClassName('first')[0].onmouseover = function(){
document.getElementsByClassName('outer-box')[0].style = "background: black"
}
document.getElementsByClassName('first')[0].onmouseout = function(){
document.getElementsByClassName('outer-box')[0].style = "background: green"
}
.first{
background: red;
width: 100px;
height: 100px;
}
.outer-box{
width: 100px;
height: 100px;
background: green;
}
<div class="icons">
<div class="first">
</div>
</div>
<div class="outer-box">
</div>
Run codeHide result source
share