-2
I’m trying to make an animation on the ::before of a paragraph every time I pass the mouse
But this CSS is overwriting everything written in the paragraph, even though it is Before instead of After.
p::before{
width:200px;
height:20px;
position: absolute;
content: "";
}
p:hover::before{
animation: blink 2s infinite alternate;
}
@keyframes blink {
from {
background-color: #89F0FF;
box-shadow: 0 0 10px #89F0FF;
}
to {
background-color: white;
box-shadow: 0 0 10px #89F0FF;
}
}
<p>Passe o Mouse Aqui</p>
It worked, thank you. Only by adding a detail that if <p> is on top of another <div> with background, that <div> must be z-index:0 and the <p> z-index:-1
– Sveen