I am attempting to create a simple animation of a circle with a border that transitions from red to a transparent color. My approach is to initially set the color to red and then animate it to transparent using keyframes as follows:
.pulse{
margin: 20px;
width:100px;
height: 100px;
background-color: red;
border-radius: 100px;
animation-name: pulse;
animation-duration: 1s;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-timing-function: ease;
}
@keyframes pulse{
0%{border:solid 1px rgba(255, 0, 0, 1)}
100%{border:solid 1px rgba(255, 0, 0, 0)}
}
<div class="animation">
<div class="pulse"></div>
</div>
Initially, it seems like nothing is happening, but upon closer inspection, I realize that the animation is indeed working. However, the transparent animation is being displayed on top of the existing red border, creating the illusion that nothing is changing. My goal is to have the border transition smoothly from red to transparent, giving the appearance of pulsating without altering the size of the circle.