Reputation: 107
I have a parent div and inside the parent div there are nested divs. What I want to do is when I hover the last child, I want it to hover over the borders of the parent divs instead of under the parent divs.
<div className="parentDiv">
<div className="childA">
<div className="childB">
<div className="childC">
{conents}
</div>
</div>
</div>
</div>
The css goes here
.parentDiv {
display: flex;
position: relative;
height: 100%;
width: 100%;
}
.childA {
position: relative;
width: 100%;
height: 100%;
}
.childB {
position: relative;
width: 100%;
height: 100%;
}
.childC {
position: relative;
width: 100%;
height: 100%;
transition: transform 450ms;
}
.childC:hover {
transform: scale(2.08);
position: absolute;
zIndex: 10;
},
This is what I have tried so far. But I cant make it hover over the parent div borders.
Upvotes: 0
Views: 35
Reputation: 4296
.childC:hover .parentDiv{
border:2px solid black;
}
This can be done with CSS
Upvotes: 1