Say I have a basic website with a navbar that has a few links. When I am on a page (say, Terms of Use), I want the “Terms of Use” link in the navbar to be highlighted. When I switch to a different page, I want that page’s link to be highlighted (i.e. I switch to privacy page, and then “Privacy” is highlighted in the navbar).
Does anyone know a simple way to do this with HTML/CSS/JS?
A simple way to do it without using javascript or php etc would be to add a different class to the body tag on each page.
Then in your css file:
SO you need XXX classes for however many nav items you have and you put a class on each nav item too as illustrated.
Make sense?