Open In App

What is the Universal Selector?

The Universal selector can be denoted by an asterisk (*), which is a special CSS selector that targets all elements on a web page. It applies a style to every element within the specified scope, making it a powerful but broad-reaching selector.

Syntax

/* Applying styles to all elements using the universal selector */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

/* Applying a border to all elements for illustration purposes */
* {
border: 1px solid #ccc;
}

Features:

Article Tags :