Dinesh Ambaliya

Dinesh Ambaliya

  • NA
  • 42
  • 80.2k

how to set styles in selected menu item.

Jul 29 2012 10:46 PM
I putted this code in master page to display menus in all this pages.
<ul> 
        <li><a id="lnkHome" href="Default.aspx">Home</a> </li>
        <li><a id="lnkAboutUs" href="AboutUs.aspx">About Us</a> </li>
        <li><a id="lnkDisclaimer" href="Disclaimer.aspx">Disclaimer</a>
        </li> <li><a id="lnkServices" href="Services.aspx">Services</a> </li>
        <li><a id="lnkContactUs" href="ContactUs.aspx">Contact Us</a> </li>
</ul>

And used css to style this menus like ul li,a:hover, a:visited……
Now how I can add difference appearance in particular <a> link if that page is currently visiting.
 E.g. If I click the About Us <a> link then it navigate to AboutUs.aspx page and then I want to
 set background image in that link and background:none in other links.


Answers (2)