Navigation menu with highlight in Asp.NET MVC?

后端 未结 7 907
广开言路
广开言路 2021-02-14 15:31

It\'s a simple question. How did stackoverflow do their menu in Asp.net MVC, with highlight on what page we are on.

相关标签:
7条回答
  • 2021-02-14 16:29

    If you look at the page source, they've added a css class to the <li> element to change the background color. I'm guessing the code looks at what controller the user is accessing (questions, users, etc) and adds the class to that section's <li> tag.

    0 讨论(0)
提交回复
热议问题