English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules (RULES)

Complete CSS Properties

CSS * Wildcard selector

Complete CSS Selector Reference Manual

Online Example

Use the wildcard "*"Select all elements and set their background color and text style:"

!DOCTYPE html>
<html>
<title>Basic Tutorial Website (www.oldtoolbag.com)/title>
<head>
<style>
*
{
background-color:green;
color:white;
}
</style>
</head>
<body>
<h1>Welcome to Basic Tutorial Website (www.oldtoolbag.com)/h1>
<div class="content">
<p class="website">Our website address is: www.oldtoolbag.com.</p>
<p class="sitename">Our website name is: Basic Tutorial Website.</p>
</div>
<p>Our website provides various basic tutorials. Learn the basics well, and you can go further! </p>
</body>
</html>
Test and see ‹/›

Definition and Usage

The wildcard "*" selector selects all elements.

The wildcard "*"Selector can also select all elements within another element:"

Online Example

Select all elements within the <div> element:

!DOCTYPE html>
<html>
<title>Basic Tutorial Website (www.oldtoolbag.com)/title>
<head>
<style>
div *
{
background-color:green;
}
</style>
</head>
<body>
<h1>Welcome to Basic Tutorial Website (www.oldtoolbag.com)/h1>
<div class="content">
<p class="website">Our website address is: www.oldtoolbag.com.</p>
<p class="sitename">Our website name is: Basic Tutorial Website.</p>
</div>
<p>Our website provides various basic tutorials. Learn the basics well, and you can go further! </p>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All mainstream browsers support*Selector.

Complete CSS Selector Reference Manual