Home > Net >  How to create a ::before for multiple #id
How to create a ::before for multiple #id

Time:09-27

Is it possible to insert multiple id in a before?

I have:

#ps4 ::before {
  [...]
}
#ps3 ::before {
  [...]
}

i tried with #ps4, #ps3 ::before but nothing, is it possible to insert more #id for a before? I would like to keep the css as clean and short as possible...

I tried looking at css-trick but I couldn't find anything explaining how to create a before for multiple id

CodePudding user response:

use :is()

:is(#ps4,#ps3)::before {
  content:"OK";
}
<div id="ps4"></div>
<div id="ps3"></div>

  •  Tags:  
  • css
  • Related