1. Home page. Html navigation section:
<ul class="dh">
<li class="act"><a href=""></a></li>
<li><a href""></a></li>
<li><a href""></a></li>
<li><a href""></a></li>
</ul>
2.
< ul class= "dh" >
<li><a href=""></a></li>
<li class="act"><a href""></a></li>
<li><a href""></a></li>
<li><a href""></a></li>
</ul>
.
after several pages are sent to the background, the background uses template inheritance to organize the navigation file into a head.html file, and then introduce this file into the navigation part of each page.
so that the navigation code for each page becomes the same.
for the time being, when I enter the onload of each page, I get the url, of the page to determine which page it is based on the url and then give it a highlight class.
but it"s troublesome to have too many pages
is there a better and more correct way to ask?