Last Updated: February 25, 2016
·
509
· ariflogic

Child or Global Child?

When writing CSS, we are often unaware to tree the element and selecting proper selector inside its parents.

.wrapper .header{}
.wrapper a{}

Surely it easy but not good. When we wanted to select the element a level under its parents we might use > to indicate it was the element after the parent

.wrapper > .header{}
.wrapper > a{}

So, in this case a, would not all a inside the wrapper will got the style, just the a after .wrapper will got the style. From this code style, we are looking to our needs just use child rather than global child if you won't it affect deeper child.