My HTML code:
<body data-spy="scroll" data-target=".dmu-top-nav" data-offset="50">
<header>
<nav class="navbar navbar-toggleable-sm navbar-expand-md dmu-top-nav fixed-top" role="navigation">
<div class="container-fluid">
<div class="dmu-nav-wrapper">
<div class="navbar-header">
<a class="navbar-brand" href="#home">
<img src="img/220px-Logo__lowres.png" width="30" height="30" alt="logo">
</a>
<button class="navbar-toggler" data-toggle="collapse" data-target="#dmu-nav-menu" aria-controls="dmu-nav-menu" aria-expanded="false" aria-label="Toggle navigation">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
In the previous HTML snippet, I have included a logo and an icon for the toggle button. I have also added classes for expand and fixed top, but it seems that it is not working as expected. Although my data-target is correctly set to .dmu-top-nav.
<div id="dmu-nav-menu" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="#home">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#news">Upcoming</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#staff">Lecture</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#student">Alumni</a>
</li>
</ul>
....
</header>
....
I am facing an issue where the active class is not changing. The second code block contains sections with href links for different pages.