Compare Grouping and Nesting in CSS ?

0

Grouping: Selectors can be grouped having the same values of property and the code be reduced.
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;}

Css
asked Apr 14, 2023 at 18:24
Sign in to add a comment

0 Answers

0
📝 No answers yet!

Be the first to answer this interview question.

Your Answer

Sign in to post your answer and help the community.