Selecting All Elements

The universal selector(*) matches every element in the document.

 
<!DOCTYPE HTML> 
<html> 
    <head> 
        <title>Example</title> 
        <style type="text/css"> 
        * { 
            border: thin black solid; 
            padding: 4px; 
        } 
        </style> 
    </head> 
    <body> 
        <a href="http://java2s.com">Visit the java2s.com</a> 
        <p>I like <span>HTML</span> and CSS.</p> 
    </body> 
</html>
  
Click to view the demo
Home 
  HTML CSS Book 
    CSS  

Selectors:
  1. Selecting All Elements
  2. Selecting Elements by Type
  3. Selecting Elements by Class
  4. Selecting Elements by ID
  5. Selecting Elements by Attribute
Related: