Rob Dodson 8/4/2013

nth-child is weird

Read Original

This article clarifies a common CSS confusion by comparing the :nth-child and :nth-of-type selectors. It uses code examples to demonstrate how :nth-child selects based on an element's overall position among siblings, while :nth-of-type selects based on its position among siblings of the same type, making the latter more robust for certain styling tasks.

nth-child is weird

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week