Complex selector don't work in last blink version :nth-child(2):nth-last-child(2){}

前端 未结 2 707
春和景丽
春和景丽 2021-01-23 02:11

there is strange problem: after blink update selector .groups .group:nth-child(2):nth-last-child(2){} just stop working. But it still works well in webkit and gecko

2条回答
  •  我在风中等你
    2021-01-23 02:33

    You are making it too complex.

    Write:

    .groups .group:first-child{ /*first child*/
        background-color:yellow;
    }
    .groups .group:nth-child(2){ /*second child*/
        background-color:red;
    }
    .groups .group:last-child{ /*last child*/
        background-color:green;
    }
    

    Working fiddle here.

提交回复
热议问题