0

May be the question title is bit confusing, but to give a specific example

body.page-status .panel.panel-info .server .dot {
  font-size: 10px;
}

I also want this rule to apply for

body.page-status .panel.panel-info .client .dot {
  font-size:10px;
}

If you see closely, the only difference between 2 selectors is .server and .client

Can I combine them in 1 rule somehow?

Thanks

Hashem Qolami
  • 93,110
  • 25
  • 145
  • 156
daydreamer
  • 80,741
  • 175
  • 429
  • 691
  • `body.page-status .panel.panel-info .server .dot, body.page-status .panel.panel-info .client .dot {` – j08691 Apr 07 '15 at 23:05

1 Answers1

1

Use a comma to group selectors:

body.page-status .panel.panel-info .server .dot,
body.page-status .panel.panel-info .client .dot {
  font-size: 10px;
}

If you were using a CSS preprocessor, like LESS, you could use:

body.page-status .panel.panel-info {
  .server, .client {
    .dot {
      font-size: 10px;
    }
  }
}
Josh Crozier
  • 219,308
  • 53
  • 366
  • 287