0

My apologies because of maybe stupid question >_<

Does below way of css definition exist officially?
In which cases such coding could be used?
Can you provide some documentation about this way?

.outer-class {
  // style declaration

  .inner-class {
    // style declaration
  }
}
Yeheshuah
  • 1,216
  • 1
  • 13
  • 28

1 Answers1

1

You need to use some kind of preprocessor that compiles to native css. Unfortunately, the current CSS specification doesn't support nesting in styles.

For instance, you can use scss that supports this kind of code & compiles it to native CSS like the following:

.outer-class {
  // style declaration
}

.outer-class .inner-class {
  // style declaration
 }

You can read more at: W3schools.

Hunny
  • 58
  • 1
  • 6