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
  • 97,268
  • 26
  • 150
  • 164
daydreamer
  • 87,243
  • 191
  • 450
  • 722
  • `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
  • 233,099
  • 56
  • 391
  • 304