c# - ASP.Net MVC: How can I easily change the tab color of my navigation menu based on the tab that I'm on? -


I want to apply my navigation tab to some people on this site, and I have heard that it uses ASP The tax was made Net MVC if I am on stackoverflow.com/users, "user" is orange in comparison to the menu tab and all others are gray, just like if a different tab is selected.

I am very good to tamper the CSS. Change colors when adding or removing / authoring items in the menu container, but the tab is not familiar with how to change the color of the tab based on the page At i Is there any quick and dirty way to accomplish this?

Assign a unique ID to the body element of each page (e.g. & lt; body id = "Users"> ). ASP.NET MVC can be written as body tag on your master page:

body id = "& lt;% = ViewData [" bodyId "]% & gt; & Gt;

and see in the administrator's methods for each pageData ["bodyId"] = "user"; To specify the id dynamically for each page,

Then in your NAV markup,

   

Then do something like this in CSS:

  body # users a.users, body # another-page a.another-page {/ * in which you Include rules for wanting to show the current page tab * /}  

This will specify your "current page" styles with a tag with any tag that is tagged with body tag ID Matches / P>


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

jquery - SimpleModal Confirm fails to submit form -