Hi there! I've implemented a hover effect on a card in my code. When the user hovers over the card, a shadow effect and an Add To Cart button will appear. However, I want to display the card shadow effect when the user hovers over the button as well. Can you please advise me on how to achieve this? Below is my HTML code along with its CSS.
/* overallCart */
.overallCart{
min-height: 272.5px;
}
/* card */
.card5-diagonal {
border-color: transparent;
width: 170px;
height: 247.5px;
margin-top: 0px;
margin-right: 15px;
position: relative;
overflow: hidden;
}
/* card overeffect */
.card5-diagonal:hover {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
/* image*/
.card5-image {
width: 144px;
height: 122px;
margin-right: 13px;
margin-left: 13px;
margin-top: 15px;
margin-bottom: 15px;
}
/* Over Button space*/
.button-space {
display: none;
}
/* Over Button hover effect */
.overallCart:hover .button-space {
display: block;
}
/* Button */
.addtocart-btn {
min-width: 170px;
max-width: 170px;
min-height: 25px;
max-height: 25px;
background-color: #212121;
color: #FFFFFF;
font-family: RR;
font-size: 12px;
outline: none;
border: #212121;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<div class="overallCart">
<div class="card card5-diagonal">
<!-- Image Start -->
<img class="card5-image" src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcT05KW2maV5ZFB9ipDuXxFCg55Rwb6Grx3iiURgsOFMpWwWX27u" />
<!-- Image End -->
</div>
<!-- Footer Start -->
<div class="btn-space">
<span class="button-space ">
<button type="button" class="addtocart-btn ">ADD TO CART </button>
</span>
</div>
<!-- Footer End -->
</div>