css - How to find certain class name elements in a specified order
漂亮男人
漂亮男人 2017-06-05 11:10:44
0
3
985

2017.07.07

12个月

2017.07.08

I want to pass

item2 .tcc:nth-of-type(2) .icon{}

Why is it invalid to add a style to the second tcc class name element? I thought about it later, do all pseudo-class selectors likenth-of-typerequire element tags before them? The tutorials on the Internet seem to be all about it, can't it be a class name?

漂亮男人
漂亮男人

reply all (3)
習慣沉默

Because

is also p, so the second tcc is actually nth-of-type(3)

    左手右手慢动作

    Not to mention whethernth-of-typeneeds to be explicitly specified,:nth-of-type(n)refers to selecting the nth child element with the specified type in the parent element, and your second.tccis the 3rd child element of.item2, not the 2nd. Maybe you should write it as.item2 .tcc:nth-of-type(3) .icon {}

      黄舟
      item2 .tcc:nth-of-type(2) .icon{}

      replaced with

      item2 .tcc:nth-child(3) .icon{}
        Latest Downloads
        More>
        Web Effects
        Website Source Code
        Website Materials
        Front End Template
        About us Disclaimer Sitemap
        php.cn:Public welfare online PHP training,Help PHP learners grow quickly!