---
title: "Discussion on \"nth-child() vs nth-of-type() Selectors in CSS – What’s the Difference?\" | Hashnode"
description: "Discussion on \"nth-child() vs nth-of-type() Selectors in CSS – What’s the Difference?\". The :nth-child() and :nth-of-type() CSS selectors select items from a group of HTML elements. But they work in different ways.\nHere is the main distinction between them:\n\nnth-child() selects its items from any group of elements. nth-of-type() selects..."
url: "https://hashnode.com/posts/nth-child-vs-nth-of-type-selector-in-css/66ba0e08d14c87384322b682"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [nth-child() vs nth-of-type() Selectors in CSS – What’s the Difference?](https://freecodecamp.org/news/nth-child-vs-nth-of-type-selector-in-css?utm_source=hashnode&utm_medium=feed)

The :nth-child() and :nth-of-type() CSS selectors select items from a group of HTML elements. But they work in different ways. Here is the main distinction between them: nth-child() selects its items from any group of elements. nth-of-type() selects...

Jan 31, 2024 · 11 min read · freecodecamp.org  
Read the article

-   [#css](https://hashnode.com/tag/css)
-   [#front-end-development](https://hashnode.com/tag/front-end-development)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Oluwatobi Sofela](https://hashnode.com/@oluwatobiss)

@oluwatobiss

  
[View profile](https://hashnode.com/@oluwatobiss)

O-sweet-programming, my interest is to make you sweeter for all.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
