How to select the first, second, or third element with a given class name?

后端 未结 7 2228

How can I select a certain element in a list of elements? I have the following:

my text
7条回答
  •  萌比男神i
    2020-11-27 15:02

    In the future (perhaps) you will be able to use :nth-child(an+b of s)

    Actually, browser support for the “of” filter is very limited. Only Safari seems to support the syntax.

    https://css-tricks.com/almanac/selectors/n/nth-child/

提交回复
热议问题