From the course: CSS Shorts

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

CSS not selector

CSS not selector - CSS Tutorial

From the course: CSS Shorts

CSS not selector

- [Instructor] Hi, this is Chris Converse. And in this episode, we'll take a look at the CSS not selector. Or more formally, the negation pseudo-class. This allows us to define a CSS rule that will select items that are not part of the selection group. So if you'd like to follow along, download the exercise files and let's begin by opening the HTML file in a text editor. Now, once you have the HTML file open, up in the head area, we have a link to style.css, which we'll be opening in a moment. Inside of the body area, we have a gallery. The gallery has an h1 and an article. And then inside of the article, we have a div for each one of the different gallery items. Now, some of these items have a data status with a value of new and others do not. So what we're going to be doing is targeting every item that does not have a data status equaling new. Now, you might want to use this feature if you have some established CSS rules in your site and you want to highlight something quickly…

Contents