CSS හි තේරීම් කණ්ඩායම් කිරීමේදී පොදු ගුණාංග

සමහර තේරීම්වල ගුණාංගවල කොටසක් සමාන වන අතර අනෙක් කොටස වෙනස් වන අවස්ථා ඇත. පහත කේතයේ, උදාහරණයක් ලෙස, ශීර්ෂ සහ ඡේදය රතු පැහැති වුවත්, ඡේදයට අමතරව තවත් ගුණාංග ඇත:

cssh2 {
  color: red;
}
h3 {
  color: red;
}
p {
  color: red;
  text-align: justify;
  font-size: 16px;
}

එවැනි අවස්ථාවක දී, නැවත නැවත එන කොටස් කණ්ඩායම් කොට, නැවත නොඑන කොටස් වෙන වෙනම ලිවිය හැකිය:

cssh2, h3, p {
  color: red;
}
p {
  text-align: justify;
  font-size: 16px;
}
Задание 1

තේරීම් කණ්ඩායම් කිරීම භාවිතයෙන් කේතය සරල කරන්න:

cssh1 {
  text-align: center;
}
h2 {
  text-align: center;
  color: blue;
}
h3 {
  text-align: center;
  font-size: 16px;
  color: red;
}
Задание 2

තේරීම් කණ්ඩායම් කිරීම භාවිතයෙන් කේතය සරල කරන්න:

cssh1 {
  text-align: center;
  color: red;
}
h2 {
  text-align: center;
  color: red;
}
h3 {
  text-align: center;
  font-size: 16px;
  color: red;
}