Rojalin Patra
Query: 22 / Answer: 25

02nd Mar 2018 .

Compare Grouping and Nesting in CSS ?


Answers

Amaresh Satapathy
Query: 22 / Answer: 28

02nd Mar 2018 .

Grouping:  Selectors can be grouped having the same values of property and the code be reduced.
 
E.g.
 
h1 {
color: blue;
}
h2 {
color: blue;
}
p {
color: blue;
}
 

It can be seen from the code that every element shares the same property. Rewriting can be avoided by writing each selector separated by a comma.

Nesting: Specifying a selector within a selector is called nesting.

 

P
{
color: red;
text-align: left;
}
.marked
{
background-color: blue;
}
.marked p
{
color: green;
}

 

 


  •  Information
  • About Forum

    This educational forum is produly developed by betaQsolutions-A leading software company in Odisha. This forum is developed to discuss the educational topics only betweeen the Students, teachers, Parents & Experts. Topic related to Career, Syllabus, Subjects, Questions, Exams etc are allowed to discuss here.

  • Statistics

    Total topics 43 • Total Query 1115 • Total members 247 • Total Answered 1286