I want to hide the icon when I hover on the h2, but my code doesn't work. What is wrong with my code?
I use Bootstrap and SCSS, but I don't think that causes my problem.
This is my HTML code:
<div class="home__container ">
<div class="home__container__icon" id="icon">
<svg xmlns="http://www.w3.org/2000/svg" width="500" height="90" fill="currentColor"
class="bi bi-check-square text-success " viewBox="0 0 16 16">
<path
d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z" />
<path
d="M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.235.235 0 0 1 .02-.022z" />
</svg>
</div>
<h2 class="home__container__head">
the Straight Path
</h2>
</div>
SCSS code is:
.home__container__head {
background-image: linear-gradient(#7ed56f, #28b485);
-webkit-background-clip: text !important;
background-clip: text;
color: transparent !important;
font-size: 5rem;
transform: scale(0.9);
display: inline-block;
transition: all 0.3s;
&:hover {
box-shadow: 2px 2px 3px #28b485;
transform: scale(1.2);
outline: 5px solid #28b485;
& #icon {
margin-top: -25px;
display: none;
}
}
}