HTML CSS examples for CSS Selector:Universal selector
The * selector selects all elements and nested elements.
Select all elements inside <div> elements and set their background color to yellow:
<!DOCTYPE html> <html> <head> <style> div * {<!-- w w w .ja va2 s. c o m--> background-color: yellow; } </style> </head> <body> <h1>Welcome to My Homepage</h1> <div class="intro"> <p id="myId">this is a test.</p> <p id="myElement">this is a paragraph.</p> </div> <p>I <b>like</b> css.</p> </body> </html>