I'm having trouble getting the background color to show for the active link class. The border changes to dashed, but the color remains the same. Can anyone help me figure out what's going on? I'm new to CSS and feeling a bit frustrated. Also, I know the text color isn't working either; I just set it to white for testing purposes. I definitely don't want white text on a white background.
nav{
margin:0 auto;
width: 75%;
}
nav a {
text-align: center;
display: block;
width: 20%;
float: left;
margin: 0px 0px 0px 30px;
padding: 20px 0px;
border: 2px solid black;
}
a:link {
font-family: sans-serif;
background-color: rgba(221, 221, 221, 1);
color: rgba(86, 19, 139, 1);
}
a:visited{
background-color: rgba(221, 221, 221, 1);
color: rgba(171, 171, 171, 1);
}
.active{
background-color: white;
color: white;
border: 5px dashed black;
}
<header>
<h1>Ulimate Frisbee History</h1>
<nav>
<a href="index.html">Home</a>
<a href="teams.html">Teams</a>
<a href="history.html" class = "active">History</a>
<a href="http://www.usaultimate.org/index.html" target="_blank">USA Ultimate</a>
</nav>
</header>