Click here to Skip to main content
12,621,882 members (33,809 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# jQuery
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 28-Dec-12 20:12pm
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

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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;
}
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 29 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100