I have two separate pages with navigation included in both. This way, it's easier to edit the navigation menu once instead of doing so on each page individually. However, I am now facing uncertainty on how to implement the 'active' class using CSS to highlight which page is currently being viewed. Here is the current code snippet:
<li><a href="../rapport/index.php" class='rapport' >Rapport</a></li>
<li><a href="../diagram/index.php" class='diagram' >Diagram</a></li>
EDIT: Below is the CSS for styling images and icons, along with a method used in Blade to set an item as active:
<li class='pil {{ ($aktiv == 'sok') ? 'active' : '' }}'> <a class='sok' {{HTML::linkRoute('sok','Søk')}}</a> </li>
CSS:
.navbar-default .navbar-nav>.active>a.rapport:before,
.navbar-nav>li>a.rapport:before { background-image: url('../images/top3.png'); }
.navbar-default .navbar-nav>.active>a.diagram:before,
.navbar-nav>li>a.diagram:before { background-image: url('../images/top2.png'); }