Attempting to create a hover animation for buttons on my webpage, I crafted the following CSS code:
#B1 {
margin: 50px;
margin-top: 50px;
margin-bottom: 50px;
flex: 1 1 auto;
padding: 20px;
border: 2px solid #f7f7f7;
text-align: center;
text-transform: uppercase;
position: relative;
overflow:hidden;
transition: .3s;
&:after {
position: absolute;
transition: .3s;
content: '';
width: 0;
left: 50%;
bottom: 0;
height: 3px;
background: #f7f7f7;
}
}
The intended animation was meant to display a small bar at the bottom of buttons within the black div section towards the bottom of the page. However, the animation isn't functioning properly. What could be causing this issue?