Select All Elements with CSS



To select all elements, use the * CSS Selector. You can try to run the following code to select all the elements,

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         *{
            color: blue;
            background-color: orange;
         }
      </style>
   </head>
   <body>
      <h1>Demo Website</h1>
      <h2>Learning</h2>
      <p id = "tutorials">Tutorials on web dev, programming, database, networking, etc.</p>
      <p>Every tutorials has lessons with illustrations and figures.</p>
   </body>
</html>
Updated on: 2020-06-24T06:33:47+05:30

230 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements