Home > DeveloperSection > Forums > What is grouping in CSS?
Chris S
Chris S

Total Post:48

Points:336
Posted on    December-21-2012 1:50 PM

 CSS-CSS3 CSS-CSS3 
Ratings:


 1 Reply(s)
 1579  View(s)
Rate this:
Hi Everyone..
What is the concept of grouping in CSS?


Vijay Shukla

Total Post:100

Points:700
Posted on    December-22-2012 3:45 AM

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:

Don't want to miss updates? Please click the below button!

Follow MindStick