There is difference.
The >
is a child selector which selects only direct/immediate elements where as #a b i
will select child elements at any depth inside the specified parent.
For your markup:
<div id="a">
<b><i>text</i></b>
</div>
<div id="b">
<b><i>text</i></b>
</div>
Both should work but still child selector is more appropriate in that situation. Consider this:
<div id="a">
<b><i>text</i></b>
</div>
<div id="b">
<b><i>text</i></b>
<b><i>text<div><span><i>text</i></span>></div></i></b>
</div>
In the above case though, the child selector will not be applied on <i>
inside the span element in <div><span><i>text</i></span>></div>
, which is not a direct child of <b>
element.
More Info:
CSS Child Selectors