Go an LI holding an <A>
- for the a:active state I want to change the CSS applied to the parent <LI>
holding it... but I Cant work out the syntax in CSS....? Sure its a simple solution...?
<li><a href="#">link</a></li>
li { background-color: yellow; }
li a:active { color: red; }
Above makes the link red on mousedown, but how can I also make the background colour of the <li>
red when <a>
is in active state?
UPDATE - not possible in CSS. jQuery solution is below:
$('li a').mousedown(function(){
$(this).parent().addClass('makeMeYellow');
});