I have two elements in a div. One of them is hidden and I want to show it when someone hover on the visible one. Through normal CSS
I have done this, but I am unable to do this through SASS
.
Here is my code:
<div class"main">
<a href="#"> Link to my account </a>
<p> john </p>
</div>
I have tried it but it doesn't work for me.
.main {
position: relative;
a {
font-size: 19px;
}
p {
position: absolute;
top: 0;
left: 0;
font-size: 18px;
background: gray;
padding: 2px 6px;
visibility: hidden;
transition: all 0.3s ease;
}
a:hover p {
visibility: visible;
}
}
So how to make the p
tag visible when someone hover on the a
tag using SASS?