views:

30

answers:

2

These appear to do the same things. I've never been sure what the difference is.

<style>
    #a > b > i{
        color: blue;
    }
    #b b i{
        color: red;
    }
</style>
<div id="a">
<b><i>text</i></b>
</div>
<div id="b">
<b><i>text</i></b>
</div>
+6  A: 
Sarfraz
typo in 3rd word ;) difference
Gaby
@Gaby: Thanks for that :)
Sarfraz
+1  A: 

Right from the specs

Child
An element A is called the child of element B if and only if B is the parent of A.
Descendant
An element A is called a descendant of an element B, if either (1) A is a child of B, or (2) A is the child of some element C that is a descendant of B.

Gaby