ul > li > a {...} and ul li a {...} in CSS?
ul > li > a selects only the direct children. In this case only the first level of the first level inside the will be selected.
ul li a on the other hand will select ALL -s in ALL -s in the unordered list
Example of ul > li
ul > li.bg {
background: red;
}
- affected
- affected
-
- NOT affected
- NOT affected
if you'd be using ul li - ALL of the li-s would be affected
UPDATE The order of more to less efficient CSS selectors goes thus:
#header.promo divh2 + pli > ulul a*[type="text"]a:hoverSo your better bet is to use the children selector instead of just descendant. However the difference on a regular page (without tens of thousands elements to go through) might be absolutely negligible.