---
title: "Discussion on \"CSS the :not() selector\" | Hashnode"
description: "Discussion on \"CSS the :not() selector\". Intro\nIn my previous post\nI wrote a bit about the :not() selector and I got a lot feedback that people never heard of this element. So I figured I would dedicate a post just to the :not() CSS selector.\nWhat is the :not() selector in CSS?\nThe :not() i..."
url: "https://hashnode.com/posts/css-the-not-selector/61268f1122e1ba252a87deec"
---

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

Discussion

# [CSS the :not() selector](https://karsvaniersel.com/css-the-not-selector?utm_source=hashnode&utm_medium=feed)

Intro In my previous post I wrote a bit about the :not() selector and I got a lot feedback that people never heard of this element. So I figured I would dedicate a post just to the :not() CSS selector. What is the :not() selector in CSS? The :not() i...

Sep 2, 2020 · 3 min read · karsvaniersel.com  
Read the article

-   [#css](https://hashnode.com/tag/css)
-   [#newbie](https://hashnode.com/tag/newbie)
-   [#learning](https://hashnode.com/tag/learning)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)

## Written by

[Kars van Iersel](https://hashnode.com/@Karsvaniersel)

@Karsvaniersel · Amsterdam, the Netherlands

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

I develop websites and web apps

Hi, my name is Kars van Iersel. I'm a Software Engineer, located in The Netherlands. I enjoy creating high quality and delightful websites and web applications.

## Responses 1

Markdown supported · ⌘↵ to post

[Emore Ogheneyoma Lawrence](https://hashnode.com/@Yoma)

[Mar 20, 2023](https://hashnode.com/posts/css-the-not-selector/61268f1122e1ba252a87deec/comment/6418d0ac6fd77cec7793b830)

very nice article Kars 👍

[Emore Ogheneyoma Lawrence](https://hashnode.com/@Yoma)

[Mar 20, 2023](https://hashnode.com/posts/css-the-not-selector/61268f1122e1ba252a87deec/comment/6418d0ac6fd77cec7793b830#reply-6418d2ae6fd77cec7793b85a)

I use the :not() pseudo-class mostly when I want to target the last or first elements in divs, be it a nav list or any normal list

.className:not(:last-child){} 🚀 to the rescue
