English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Complete CSS Selector Reference Manual
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 ‹/›
The wildcard "*" selector selects all elements.
The wildcard "*"Selector can also select all elements within another element:"
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 ‹/›
IEFirefoxOperaChromeSafari
All mainstream browsers support*Selector.