CSS nth-match doesn't work

后端 未结 3 1991
自闭症患者
自闭症患者 2020-12-06 17:00

nth-match is supposed to work in jsfiddle following way

:nth-match(even of p,h3) {text-decoration: underline;}

this should underline every

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-06 17:36

    CSS4 selectors don't have much browser support at the moment, see here.

    You could use nth-of-type, a CSS3 selector that has greater browser support (see here):

    p:nth-of-type(even) {text-decoration: underline;}
    

    DEMO

提交回复
热议问题