Greetings for posing your query and joining our community! Moving forward, please share any code snippets you have created so that others can benefit from it and enhance their learning :).
Regarding your issue, the solution lies in using an active class in CSS to alter the state of your navigation item.
To accurately determine the current page you are on, you will need to utilize a programming language. One viable option is to employ PHP, as elaborated in this informative post How to set current page "active" in php
We trust this guidance proves valuable
Sample HTML Code
<ul class="nav">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
Here is a snippet of CSS Code
.nav-item {
border: none;
outline: none;
padding: 10px 16px;
background-color: #f1f1f1;
cursor: pointer;
}
/* Style the active class (and on mouse-over) */
.active, .nav-item:hover {
background-color: #666;
color: white;
}