CSS Selectors

CSS selectors are used to target HTML elements and apply styles to them.

Tutorials dojo strip

Element Selector

Targets elements by their tag name.

CSS

Class Selector

Targets elements with a specific class attribute, using a dot ( . ).

CSS

ID Selector

Targets an element with a specific ID attribute, using a hastag ( # ).

CSS

Universal Selector

Targets all elements on the page.

CSS

Group Selector

Applies the same styles to multiple selectors, separated by commas.

CSS

Descendant Selector

Targets elements that are descendants of another element.

CSS

Child Selector

Targets direct children of a specified element.

CSS

Adjacent Sibling Selector

Targets an element immediately following a specified element.

CSS

General Sibling Selector

Targets all sibling elements following a specified element.

CSS

Attribute Selector

Targets elements based on their attribute values.

CSS

CSS Selector Example Code

HTML

CSS Labs

Tutorials dojo strip