CSS klasių grupavimas

Tarkime, kad turime keletą klasių, kurios dažo elementus į skirtingas spalvas:

css.xxx {
  color: green;
}
.yyy {
  color: red;
}

Tarkime, kad norime padaryti taip, kad šios klasės be spalvos, nustatytų ir šrifto dydį:

css.xxx {
  color: green;
  font-size: 30px;
}
.yyy {
  color: red;
  font-size: 30px;
}

Kad abi klasės nustato vienodą šrifto dydį, panaudokime selektorių grupavimą taip:

css.xxx {
  color: green;
}
.yyy {
  color: red;
}

.xxx, .yyy {
  font-size: 30px;
}
Задание 1

Supaprastinkite kodą, naudodami selektorių grupavimą:

css.eee {
  font-size: 20px;
  line-height: 1.5;
  font-family: Arial;
}
.zzz {
  font-size: 30px;
  line-height: 1.5;
  font-family: Arial;
}
Задание 2

Supaprastinkite kodą, naudodami selektorių grupavimą:

css.eee {
  font-size: 20px;
  text-align: center;
  font-family: Arial;
}
.zzz {
  font-size: 30px;
  text-align: center;
  font-family: Arial;
}
.ggg {
  font-size: 35px;
  text-align: center;
  font-family: Arial;
}