I used this website as a source to learn how to make the hover animation.
Here is my HTML:
.navLinks {
font-family: 'Raleway';
font-size: .9em;
text-transform: uppercase;
text-decoration: none;
color: #000;
position: relative;
}
.navLinks:hover {
color: #000;
/* border-left: 1px solid white;
border-right: 1px solid white;
padding: .5em .5em; */
}
.navLinks:before {
content: "";
position: absolute;
width: 100%;
height: 2px;
bottom: 0px;
left: 0px;
background-color: #000;
visibility: hidden;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
.navLinks:hover: {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
<nav class="container">
<div class="menu1">
<a href="#home" class="navLinks">Home</a>
</div>
<div class="menu2 ">
<a href="#upcoming" class="navLinks">Upcoming Tournaments</a>
</div>
<div class="logo">
<p>It's Academic</p>
</div>
<div class="menu3">
<a href="#history" class="navLinks">History</a>
</div>
<div class="menu4">
<a href="#faq" class="navLinks">Contact Info</a>
</div>
</nav>
I only put in the code that pertains to the animation. So I'm not sure why this isn't working but there's no animation when I hover.