HTML CSS examples for CSS Selector:element group
To select several elements, separate each element name with a comma.
Select all <h1> elements AND all <p> elements:
<!DOCTYPE html> <html> <head> <style> h1, p {<!--from ww w.j a v a 2 s .com--> background-color: red; } </style> </head> <body> <h1>Welcome to My Homepage</h1> <div> <p>this is a test.</p> <p>this is a paragraph.</p> </div> <p>I <b>like</b> css.</p> </body> </html>