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.
Written by Arif Setyawan
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Related Tags
#css
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#