Selector Unions

A list of comma-separated selectors apply to the union of all of the elements.

The selector union has the following syntax:

 
<selector>, <selector>, <selector>
  
 
<!DOCTYPE HTML> 
<html> 
    <head> 
        <title>Example</title> 
        <style type="text/css"> 
        a, [lang|="en"] { 
            border: thin black solid; 
            padding: 4px; 
        } 
        </style> 
    </head> 
    <body> 
        <a href="http://java2s.com"> Visit the java2s.com </a> 
        <span lang="en-uk">HTML</span>
            
    </body> 
</html>
  
Click to view the demo
Home 
  HTML CSS Book 
    CSS  

Selectors Combination:
  1. Selector Unions
  2. Selecting Descendant Elements
  3. Selecting Child Elements
  4. Immediate Sibling Selector
  5. General Sibling Selector
Related: