WHAT IS GROUPING IN CSS?

Chris S

Total Post:48

Points:336
Posted by  Chris S
 2009  View(s)
Ratings:
Rate this:
Hi Everyone..
What is the concept of grouping in CSS?
  1. Vijay Shukla

    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:

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!