<?xml version="1.0" encoding="utf-8"?>

CSS universal selector

CSS universal selector Bad Practice
CSS universal selector Best Practice

The universal selector is marked with an asterisk (*) and serves as the basis for other selectors. It selects all elements regardless of their type. For example, creating a rule for the selector that adds a red background to an element will add red background to every single element of the page:

* {

background-color: red;

}

The universal selector is often used in combinations with other selectors, allowing us to select all elements inside another element.

Improve your UX & Product skills with interactive courses that actually work