Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

how to highlight the nav menu bar when I go to the page?

so my website doesn't highlight the nav menu bar when I go to the page. How can I make that happen?

http://monajalal.github.io/education.html

Also here's the code: https://github.com/monajalal/monajalal.github.io

P.S.: It is a bootstrap4 based website. Not sure if I should have selected CSS as question category.

Hi Mona,

Are you trying to highlight the nav link of the page that is currently loaded? If so, change the class "active page-item" to the corresponding a tag of your active page, and it should do the trick. Currently your first link "Mona Jalal" has that class on each page.

2 Answers

Add class active to the specific elements, which you would like to highlight. If Bootstrap custom class is not enough for you, you can add new css rule to the specific item.

worked, thanks <a class="nav-item nav-link active page-item" href="projects.html">Projects</a>