Using regular expression in css?

前端 未结 8 1581
野的像风
野的像风 2020-11-22 06:01

I have an html page with divs that have id(s) of the form s1, s2 and so on.

8条回答
  •  孤独总比滥情好
    2020-11-22 06:20

    As complement of this answer you can use $ to get the end matches and * to get matches anywhere in the value name.

    Matches anywhere: .col-md, .left-col, .col, .tricolor, etc.

    [class*="col"]
    

    Matches at the beginning: .col-md, .col-sm-6, etc.

    [class^="col-"]
    

    Matches at the ending: .left-col, .right-col, etc.

    [class$="-col"]
    

提交回复
热议问题