Search within TutorialsPark

CSS Child Selector


Selects childrens of an Element


Definition and Notes.

1. Used to apply CSS styles to elements that are immediate children(s) of the specified element and not grandchild descendents.

2. The Selector is created using a greater-than sign (>) between the parent and child selector. Eg: x>y

3. Eg: For selector body > p will select element <p> which are direct child of <body> element and not any grand-children.


Pattern:

CSS Child selector. internetexplorer safari firefox opera chrome

View in Splitscreen»

Code-Editor:

Note: In the above example the element <p> within <div id="article"> is a grand-child, hence not selected.

Related Examples.