Home > DeveloperSection > Forums > Direct child selectors in css
E E Cummings
E E Cummings

Total Post:26

Points:182
Posted on    June-14-2013 8:56 AM

 CSS-CSS3 CSS-CSS3 
Ratings:


 1 Reply(s)
 979  View(s)
Rate this:
Hi Expert,

what is direct child selectors in css and how to use this? Please guide me.

Thanks in advance.


Dev Patel

Total Post:26

Points:182
Posted on    June-17-2013 4:19 AM

Hi,

Direct child selectors operate much like descendant selectors in that they also rely on an ancestral relationship to decide where to apply style. Descendant selectors, however, are more ambiguous because they apply to any descendant of an element; the descendant cab be a grandchild or a great-grandchild, or a great-great-grandchild, and so on. Direct child selectors apply only to immediate children of the element. 

e.g. 

p > span.inline-code {
font-family: monospace;
}

Don't want to miss updates? Please click the below button!

Follow MindStick