I was wondering how I would add the ability to add a highlighted field to the navigation bar on the page you are currently on. You know that people know which page they are on.
I really like this site with a white box on the active page: https://woodycraft.net/home/
Here is the CSS for my navigation bar:
*{margin: 0px;
padding: 0px;}
#nav_bar {background-color: #a22b2f;
box-shadow: 0px 2px 10px;
height: 45px;
text-align: center;}
#nav_bar > ul > li {display: inline-block;}
#nav_bar ul > li > a {color: white;
display: block;
text-decoration: none;
font-weight: bold;
padding-left: 10px;
padding-right: 10px;
line-height: 45px;}
#nav_bar ul li ul {display: none;
list-style: none;
position: absolute;
background: #e2e2e2;
box-shadow: 0px 2px 10px;
text-align: left;}
#nav_bar ul li a:hover {background: #8e262a;}
#nav_bar a:active {background: white;}
#nav_bar ul li:hover ul {display: block;}
#nav_bar ul li ul li a {color: #252525;
display: block;}
#nav_bar ul li ul li a:hover {background: #4485f5;
color: #fff;}
Here is the HTML for one of my pages:
<div id="nav_bar">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="status.html">Status</a></li>
<li><a href="info.html">Info</a></li>
<li><a href="#">Gamemodes</a>
<ul>
<li><a href="survival.html">Survival</a></li>
<li><a href="pure-pvp.html">Pure-PVP</a></li>
<li><a href="gamesworld.html">Gamesworld</a></li>
</ul>
</li>
<li><a href="rules.html">Rules</a></li>
<li><a href="vote.html">Vote</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>
user4171782
source
share