HTML
CSS
PHP
Deno
Examples
Do It Yourself
Blog
Type in your code below
Run
<!DOCTYPE html> <html> <head> <style> div:first-child { color: yellow; } </style> </head> <body> <div>I am the first child of BODY</div> <div>I am the second child of BODY</div> <div>I am the third child of BODY</div> <div class="example"> <div>I am the first child of my parent</div> <div>I am the second child of my parent</div> </div> </body> </html>
Related Chapters
CSS Pseudo-Classes Selectors
CSS Positions
CSS Grouping
CSS Selectors
Related Examples
HTML CSS Tag Name Selector Description
CSS Pseudo Class :nth-child()
CSS Links pseudo last Child
CSS Selectors Grouping Intro
CSS Links Pseudo Class