CSS Selector

Universal Selector

CSS Universal Selector
  • The universal selector is used as a wildcard character. It selects all the elements on the pages.

Syntax:

*{
property : value;
}

For example:

<!DOCTYPE html>
<html>
<head>
<style>
* {
color: green;
font-size: 20px;
}
</style>
</head>
<body>
<h2>This is heading</h2>
<p>This style will be applied on every paragraph.</p>
</body>
</html>
Cristle Academy

Compiler