I want to hover image or text in a div
, and want to change the background-color
of the whole div
including the inner div
of the hovering element.
Here is the code:
.hover-div {
padding: 20px;
display: none;
font-size: 15px;
font-family: sans-serif;
background-color: #186459;
color: white;
}
.hover-object:hover+.hover-div {
background-color: #666666;
display: block;
}
<div className="touch">
<div className="hover-object">
<img src={dashboardkpi} className="svg-image" alt='img' />
<p className="item-names">Dashboard KPI</p>
</div>
<p className="hover-div">View business analytics</p>
</div>
I want to Hover class="hover-object"
and change the background color of whole div
named 'touch' to blue and display class="hover-div"
content.
Till now, when i hover , only hover-div
appears with change background color. I wish when i hover, the hover content display and the whole div 'touch' background color change.