---
title: "Explain all selectors in CSS3"  
description: "CSS3 introduces some new selectors that provide more flexibility and targeting elements in a document."  
author: "Ashutosh Patel"  
published: 2024-06-07  
updated: 2024-06-07  
canonical: https://www.mindstick.com/blog/304322/explain-all-selectors-in-css3  
category: "css-css3"  
tags: ["css-css3", "css", "css selector"]  
reading_time: 3 minutes  

---

# Explain all selectors in CSS3

### CSS3 Selectors

CSS3 has introduced many new [selectors](https://www.mindstick.com/interview/22831/what-is-the-use-of-selectors-in-objective-c) that provide more flexibility and power in [targeting](https://answers.mindstick.com/qa/34553/what-are-the-targeting-options-in-display-network-ads) [elements](https://www.mindstick.com/forum/1440/wpf-button-with-multiple-text-elements) within the [document](https://www.mindstick.com/articles/328642/what-to-consider-while-choosing-a-software-documentation-tool).

## Here are some of the key CSS3 selectors

**[Universal](https://answers.mindstick.com/qa/101376/who-s-the-current-wwe-universal-champion) [Selector](https://www.mindstick.com/interview/23419/action-selector-in-mvc) (**`*`**)**

Although not new to CSS3, the universal selector targets all elements in the document.

```css
* {
   /* Applied styles on all elements */
}
```

## [Attribute](https://www.mindstick.com/blog/221/attributes-reflection) Selectors

CSS3 introduced a number of attribute selectors to target elements based on their attributes.

```css
/* Selects the elements using specific attribute */
[attribute] {
   /* Applied styles on specified attribute elements */
}
/* Selects elements by specific attribute with value */
[attribute="value"] {
   /* Applied styles on elements that have specified attribute and value */
}
/* Selects elements using attribute starting with the specified value */
[attribute^="value"] {
   /* Applied styles on elements using attribute starting with the specified value */
}
/* Select the elements using an attribute ending with the specified value */
[attribute$="value"] {
   /* Applied styles on elements using attribute ending with the specified value */
}
/* Selects elements that have an attribute with the specified value */
[attribute*="value"] {
   /* Applied styles on elements that have attribute containing the specified value */
}
```

**Child Selectors (**`>`**)**

A child connector refers to an element that is a direct child of another element.

```css
/* Select the direct children of an element */
parent > child {
   /* Styles applied to direct children of the parent element */
}
```

**Adjacent Sibling Selector (**`+`**)**

An adjacent sibling connector refers to an element with an immediately preceding sibling element.

```css
/* Selects the element immediately preceding another element */
element + adjacent-sibling {
   /* Applied css style to the adjacent sibling element */
}
```

**General Sibling Selector (**`~`**)**

A generic sibling joiner refers to all sibling elements following an element.

```css
/* Selects all sibling elements that come after an element */
element ~ sibling {
   /* Applied css styles to sibling elements following the element */
}
```

**Negation Selector (**`:not()`**)**

The Negativity pseudo-class allows you to select [objects](https://www.mindstick.com/forum/145447/what-are-objects) that do not match the specified selector.

```css
/* Selects elements that are not of a certain type */
:not(selector) {
   /* Apply styles to elements that do not match the specified selector */
}
```

These are some of the basic CSS3 choices that provide more [advanced](https://www.mindstick.com/articles/12993/5-advanced-features-for-your-odoo-ecommerce-theme) ways to target elements within a document, allowing for greater flexibility and control over the format.

**Also, Read:** [Understanding CSS Units (em, rem, px, cm)](https://www.mindstick.com/blog/304313/understanding-css-units-em-rem-px-cm)

---

Original Source: https://www.mindstick.com/blog/304322/explain-all-selectors-in-css3

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
