raygold Posted February 15, 2013 Share Posted February 15, 2013 I'd like to know what's the correct css syntax for code below: element>id>pseudo-classa#red:hover {color:red;} or id>element>pseudo-class#red a:hover {color:red;} I think first css example shuold be right, but the second is used in this link http://www.w3schools...rites_hover_nav and it works properly. Link to comment Share on other sites More sharing options...
jeffman Posted February 15, 2013 Share Posted February 15, 2013 (edited) They mean different things; which one is correct depends on your HTML. 1. targets a link with id="red"2. targets a link that is a descendent of some other element with id="red" In the example, #home a:hover targets a link that is a child of a <li> with id="home" Edited February 15, 2013 by Deirdre's Dad 1 Link to comment Share on other sites More sharing options...
raygold Posted February 15, 2013 Author Share Posted February 15, 2013 Very clear. Thanks for reply Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now