Grupimi i Klasave në CSS

Le të supozojmë se kemi disa klasa që i ngjyrosin elementet në ngjyra të ndryshme:

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

Le të supozojmë se duam që këto klasa, përveç ngjyrës, të vendosin gjithashtu madhësinë e shkronjave:

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

Meqenëse të dyja klasat vendosin të njëjtën madhësi shkronjash, le të përdorim grupimin e selektorëve në mënyrën e mëposhtme:

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

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

Thjeshtoni kodin, duke përdorur grupimin e selektorëve:

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

Thjeshtoni kodin, duke përdorur grupimin e selektorëve:

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;
}