How can i change color of anchor text inside an li on mouseover of that element? code is here Any idea plz share.
You need to code the css part some looks like this a:hover{color:#666666; background:#fefefe; } Code (markup): the color - is the color of text background - is the background-color of that element can u please send ur css code here
I want to set both properties fo li and color for anchor text as well. Which you mentioned here is working fine but anchor color is not changing. How can i do that?
Although a bit late reply. Default CSS: li a, li a:visited, li a:active, li a:link{ color:#ff00ff; } Code (markup): When list item hover is called, change the anchor link color inside the list item: li:hover a, li:hover a:visited, li:hover a:active, li:hover a:link{ color:#00ff00; } Code (markup):
Let me see if I understand what you're asking here. You want to change the color of a.anchor (the "services" link) on hovering over one of the subnav elements? Or, you want to change the color of all the subnav elements on hovering over a.anchor ("services")? If this is the case, that's easy, because the subnav list is inherited from another list. What you should do is assign a class name to the li: <li class='something'><a class='anchor'></a> <ul class='subnav'> <li><a>... <li><a>... </ul> </li><!--end li.something--> Code (markup): and do this: li.something:hover ul.subnav a { color: ... } Code (markup): On the other hand, if you want to change the hover styles of a parent or unrelated element, you are going to have to use javascript getElementById, or maybe getElementsByClassName, but I'd try to design around such tactics unless it's really critical.