Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

CSS3: Differences in child styling

CSS3: Differences in child styling

Problem

I'm not sure if my question title accurately displays what I'm trying to ask, but this is pretty much my first exposure to CSS3 and have been exploring various projects people have done in order to gain some hands on experience.

In searching through these projects I cam across something I'm having some trouble understanding. What exactly is the Difference between the following two lines:

#random_ID > ul > li > a { ... }

#random_ID ul li a { ... }

Are these just two ways of writing the same thing? Any help would be greatly appreciated!

Problem courtesy of: Shawn Taylor

Solution

The greater than symbol limits the lookup to just first-level descendants: children of the selector on the left. Without the symbol, it can be any descendent at any level.

So the first example, it's "random_ID with a child ul with a child li with a child a" and the second is "random_ID with any descendant ul with any descendent li with any descendent a"

Solution courtesy of: Matt

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

CSS3: Differences in child styling

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×