user5957283
user5957283

Reputation:

How to combine multiple selects?

How can I combine these two rules into one?

#body_splash{
  width: 100%;
  height: 100%;
  display: none;
  opacity: 0;
}
#body_main{
  width: 100%;
  height: 100%;
  display: none;
  opacity: 0;
}

I tried

#body_splash #body_main

and

#body_splash#body_main

but neither worked

Upvotes: 3

Views: 50

Answers (3)

itsmikem
itsmikem

Reputation: 2168

This will also work:

div[id^='body_']

Assuming they both have the same tag, like div, this looks for all divs with an id that starts with "body_"

Upvotes: 0

Mushr00m
Mushr00m

Reputation: 2356

use commas to separate them :

#body_splash,
#body_main {
  width: 100%;
  height: 100%;
  display: none;
  opacity: 0;
}

Upvotes: 4

Richard Hamilton
Richard Hamilton

Reputation: 26444

Seperate multiple selectors with a comma

#body_splash, #body_main {
  width: 100%;
  height: 100%;
  display: none;
  opacity: 0;
}

Upvotes: 3

Related Questions