I have created a navigation bar at the top of my website screen. I want to implement a feature where the word corresponding to the current page is highlighted. For example, if I am on the "Contact" page, the word "Contact" should be highlighted, and so on. The catch is that I can only use CSS and HTML to achieve this.
body {
background: black;
}
nav {
padding:0;
right:1vw;
margin: 0 0 0px 0;
position: fixed;
top: 0vh;
text-align:center;
background-color:rgba(255, 255, 255, 0.4);
width:98%;
-moz-border-radius: 15px;
border-radius: 15px;
}
nav li {
top:2vh;
font-family:Verdana, Geneva, sans-serif;
font-size: 13pt;
display: inline-block;
margin-left:2vw;
margin-right:2vw;
margin-bottom:2vh;
margin-top:2vh;
}
nav li a {
white-space: nowrap;
display: block;
text-decoration: none;
text-transform: uppercase;
text-shadow: 1px 1px 2px rgba(71, 80, 23, 0.3);
color: #fff;
padding: 0;
letter-spacing: 1px;
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
text-align:center;
}
nav:hover li a {
}
nav li a:hover {
background: transparent;
text-shadow: 0px 0px 20px #cc9900;
color: #ffff99;
}
<nav>
<li><a href="/index.html">Home</a></li>
<li><a href="/dedump.html">De dump</a></li>
<li><a href="/opdrachten.html">Opdrachten</a></li>
<li><a href="/groepsopdracht.html">Groepsopdracht</a></li>
<li><a href="/overmij.html">Over mij</a></li>
<li><a href="/contact.html">Contact</a></li>
</nav>