CSS Child Selector

Use the child selector, if you want to select all elements immediate children of a specified element.

div > p

Example

You can try to run the following code to implement CSS Child Selector


   
      
   
   
      
         

Para 1 in the div.

                   

Para 2 in the div.

     
     

Para 3 outside the div.

   

Output

Updated on: 2026-03-11T22:50:41+05:30

451 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements