Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
XML
Please help
If i click anchor tag then this page is active and background colour changed.

<ul>
    <li><a href="index.php">HOME</a></li>
    <li><a href="two.php">PORTFOLIO</a></li>
    <li><a href="three.php">ABOUT</a></li>
    <li><a href="four.php">CONTACT</a></li>
    <li><a href="five.php">SHOP</a></li>
</ul>
Posted
Comments
ssyuvaraja 29-Dec-12 4:36am    
I did not understand the question. Is this like, If you click the "Shop" anchor tag, the color of the "Shop" anchor tag need to be changed? or please tell the problem clearly.
Ashish Rathod 29-Dec-12 6:09am    
If i click HOME then this tag is active and color is changed but when i click next tag like SHOP then this tag is active not HOME tag is active so SHOP tag color changed not HOME.

1 solution

CSS
You try this CSS style: I hope you asking for this only.

//normal link
ul li a
{
 color:#FFF;
}

//while mouse hover
ul li a:hover
{
 color:#FFF;

}

//hold the link
ul li a:active
{
 color:#FC0;
}

//after clicked
ul li a:visited
{
 color:#ff0;
}
 
Share this answer
 
Comments
Ashish Rathod 29-Dec-12 5:43am    
If i click HOME then this tag is active and color is changed but when i click next tag like SHOP then this tag is active not HOME tag is active so SHOP tag color changed not HOME.
ssyuvaraja 29-Dec-12 7:12am    
Please try the order as "normal link,Visited,Mouse hover, Active" order. If this is not worked means, Then have to use Jquery/JS. Please clear browser history after change code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900