CSS regex selector match one OR another condition?

后端 未结 2 920
有刺的猬
有刺的猬 2021-01-02 04:46

I\'d like to match when /(\\sclassName|^className)/ is satisfied, but when selecting css. Hypothetically I would use like:



        
2条回答
  •  轮回少年
    2021-01-02 05:34

    You can use the following selectors to select any element whose class either starts with "icon-" or contains " icon-" (note the space at the start):

    [class^="icon-"], [class*=" icon-"] { ... }
    

    JSFiddle demo.

提交回复
热议问题