Heeeey, ninjas! So in this CSS tutorial for beginners I’ll be going through what exactly the first and last child pseudo classes are, and how they can help you target elements you wouldn’t think possible without using a class or ID!

Last and first child are both STRUCTURAL pseudo classes, that is, they help to select very specific elements within the HTML structure, or DOM (document object model). Keep coding and have fun.

MC Ninja, signing out.


========== CSS for Beginners Playlist ==========
========== HTML Basics Course ==========

========== The Net Ninja ============

For more front-end development tutorials & to black-belt your coding skills, head over to – or

========== Social Links ==========

Twitter – @TheNetNinja –


  1. your tutorials are the best on so many levels! very well explained and very funny. always make me laugh :') oh and music in the end, love it!

  2. Hello sir, that was really great but what if the tags within the parent tag are different tags for example the tags u had in above example was all paragraphs what if there r different tags such as h1, a & link would it work if we placed like that article:first-child{}.


Please enter your comment!
Please enter your name here