michaellunsford Posted February 6, 2007 Share Posted February 6, 2007 what's the difference? div.container a { color:#000 } div.container > a { color:#000 } Link to comment https://forums.phpfreaks.com/topic/37248-difference-between-a-child-combinator-and-a-descendant-combinator/ Share on other sites More sharing options...
ToonMariner Posted February 6, 2007 Share Posted February 6, 2007 the first will style ANY a tag that is a decendant of div.container ie <div class="container"> <a .... <div class="subcontainer"> <a .... </div> </div> the second should only work on an anchor tag that is a first child of div.container i.e. <div class="container"> <a .... </div> But not any anchor that is a child of a child of div.container. Link to comment https://forums.phpfreaks.com/topic/37248-difference-between-a-child-combinator-and-a-descendant-combinator/#findComment-178039 Share on other sites More sharing options...
michaellunsford Posted February 6, 2007 Author Share Posted February 6, 2007 That makes sense. Thanks! Link to comment https://forums.phpfreaks.com/topic/37248-difference-between-a-child-combinator-and-a-descendant-combinator/#findComment-178152 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.