Selects all elements with class="mydemo" with CSS

CSSWeb DevelopmentFront End Technology

To select all elements with class=”mydemo”, you can try to run the following code. Use the .class CSS selector to achieve this,

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         .demo {
            border: 2px dashed orange;
         }
      </style>
   </head>
   <body>
      <h1 class = "demo">Heading 1</h1>
      <h1>Heading 1</h1>
      <h2>Heading 2</h2>
   </body>
</html>
raja
Published on 16-May-2018 13:21:06
Advertisements