I am trying to change the text color to black from white when the button is hover and every thing good in the code except that the text color does not change. does someone know how do I make it work?
.main__btn {
font-size: 1.2rem;
background: rgba(0, 0, 0, 0);
padding: 15px 50px;
border-radius: none;
border-color: #fff;
margin-top: 2rem;
cursor: pointer;
position: relative;
transition: all 0.35s;
outline: none;
}
.main__btn a {
position: relative;
z-index: 2;
color: #fff;
text-decoration: none;
}
.main__btn:after {
position: absolute;
content: '';
top: 0;
left: 0;
width: 0;
height: 100%;
background: #ffffff;
transition: all 0.35s;
border-radius: 4px;
}
.main__btn:hover {
color: #000;
}
.main__btn:hover:after {
width: 100%;
}
<button class="main__btn" id="button1"><a href="#">button1</a></button>