Direct Child Selectors

They are similar to the descendant selectors as the use the HTML hierarchy to apply style. But, they apply styles only to immediate children or the immediate nested element of the designated element.  The ‘>’ sign or a greater than or right angled bracket, is used to separate each element in the selector. IE6 does not support it.

Its usage is shown as
      p> .top
{font-weight: bold;}
In the example the descendent selector ‘p >’ makes direct child of the p element with the class name of top bold. It is also illustrated asDirect Child Selector

Get industry recognized certification – Contact us

Menu