What is grouping in CSS?

Total Post:48

Points:336
 2405  View(s)
Ratings:
Rate this:
Hi Everyone..
What is the concept of grouping in CSS?
  1. Post:100

    Points:700
    Re: What is grouping in CSS?

    You can give the same properties to a number of selectors without having to repeat them by separating the selectors by commas.

    Sample code:
    <html>
    <head>
    <style>
    h1,h2,p
    {
       color:green;
    }
    </style>
    </head>
    <body>
       <h1>This is heading 1</h1>
       <h2>This is heading 2</h2>
       <p>This is a paragraph.</p>
    </body>
    </html>

    Below is Output:

      Modified On Mar-29-2018 05:54:33 AM

Answer