0 votes
in HTML by
What Selector Nesting in Sass is used for?

1 Answer

0 votes
by

Sass let you nest your CSS selectors in a way that follows the same visual hierarchy of your HTML. CSS, on the other hand, doesn't have any visual hierarchy.

Consider example (scss):

.parent {
  color: red;

  .child {
    color: blue;
  }
}

Result (css):

.parent {
  color: red;
}

.parent .child {
  color: blue;
}
...