ASP.NET - CSS active property is not working - Asked By vijaya saladi on 09-Jan-12 04:02 AM

 Hai all.,

                  I have a menu bar in this i want to highlight tab when user is on that page.,example if user in HOME page .,Homepage tab highlighted in header menu.In my menu bar link,visited,hover everything works fine but when I applied the active it just blinks with respective color when I place the mouse over the tab.

Please give me a solution.,I tried a lot for search about this.In some forums they tell it works like blink(ex:W3C) but in some forums they tell it stay remains when user have to move to another page.



Here is my code:


<div class="suckertreemenu">
            <ul id="treemenu1">
                <li><a id="home" href="../master/Homepage.aspx">Home</a></li>
                <li><a id="about" href="#">About US</a></li>
                <li><a id="regsistration" href="#">Registration</a>
                    <ul id="registrationmenu" style="background-color: White">
                        <li><a id="stdudentregistration" href="../wires/StudentRegistrationPage.aspx">Student
                        </a></li>
                        <li><a id="sponsorregistration" href="../wires/SponsorRegistrationPage.aspx">Sponsor
                        </a></li>
                    </ul>
                </li>
                <li><a id="news" href="#">News Room</a></li>
                <li><a id="studentlist" href="../wires/Availblestudents.aspx">SP Students</a>
                </li>
            </ul>
            <br style="clear: left;" />
        </div>
CSS Code:
.suckertreemenu ul li ul li a:link
{
    display: block;
    width: 100px; /*width of sub menu levels*/
    color: white;
    text-decoration: none;
    padding: 1px 5px;
}
.suckertreemenu ul li ul li a:hover
{
   background-color: White;
    color: Black;
}
.suckertreemenu ul li a:hover
{
    background-color: White;
    color: Black;
}
.suckertreemenu ul li a:active
{
    color: Red;
}

Thanks In advance.,
Vijaya.S
Suchit shah replied to vijaya saladi on 09-Jan-12 04:48 AM

a:active only fires when the link is clicked for a split second. IT DOES NOT MEAN THE CURRENT PAGE which most people assume. http://www.w3.org/TR/CSS2/selector.html#dynamic-pseudo-classes
 
If you want to have the current page have a different style, you need to manually add a class to the link.