I’m trying to style my links and I have used this code for that:
.navtext {
position:absolute;
top:130px;
right:50px;
color:#ffffff;
font-size:20px;
z-index:3;
}
a.navtext:link {
color:#ffffff;
text-decoration:none;
}
a.navtext:hover {
color:#ffffff;
text-decoration:underline;
}
a.navtext:visited {
color:#ffffff;
text-decoration:none;
}
And here is my html:
<div class="navtext">
<a href="index.php">Home</a>
<a href="about.php">About</a>
<a href="school.php">School</a>
<a href="workshop">Workshop</a>
<a href="contact.php">Contact</a>
</div>
But they are staying as the default (Link: blue, underlined. No Hover. Visited: Purple, underlined.
a.navtextselects an<a>tag with the class “navtext”.You have no such
<a>tag. Your<a>tags have no classes.Try something like
.navtext ainstead. This selects an<a>tag within an element with the class “navtext”.