nth-child 必须保证前面 没有兄弟节点 ,要么用div包住。
前面 有兄弟节点 的,可以用 nth-of-type(1) ,效果和nth-child一样。
nth-of-type(1)
1、first-child无效的问题 - CSDN
← css写出中间粗两头细的线 如何用scss写css? →