HTML
CSS
PHP
Deno
Examples
Do It Yourself
Blog
Type in your code below
Run
<!DOCTYPE html> <html> <head> <style> div:last-child { color: green; } </style> </head> <body> <div class="example"> <div>I am the first child of my parent</div> <div>I am the second child of my parent</div> <div>I am the last child of my parent</div> </div> <div class="example"> <div>I am the first child of my parent</div> <div>I am the last 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 Selectors Grouping Intro
CSS Links Pseudo Class
CSS Links Pseudo id