I'm currently learning CSS and have encountered a problem with the hover effect on a box element. The issue is that even when the mouse is placed under the box (content element), the hover effect still works. I'm wondering why this is happening and if there's a solution within my existing code?
body {
margin: 0;
padding: 0;
font-family: sans-serif;
}
.container {
width: 1200px;
height: 300px;
margin: 240px auto;
position: relative;
}
.container .box {
position: relative;
width: calc(400px - 30px);
height: calc(300px - 30px);
background-color: #000;
float: left;
margin: 15px;
box-sizing: border-box;
border-radius: 10px
}
/* More CSS rules... */
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css" rel="stylesheet"/>
<div class="container">
<div class="box">
<div class="icon"><i class="fas fa-search"></i></div>
<div class="content">
<h3>Search</h3>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.</p>
</div>
</div>
<div class="box">
<div class="icon"></div>
</div>
<div class="box">
<div class="icon"></div>
</div>
</div>