想要前几个元素,设前i个
元素:nth-child(-n+i){ 执行的操作 }
想要前7个
.user-img:nth-child(-n+7){ margin-bottom: 20px; }
本文标题:css 选取元素前n个
本文链接:https://www.haomeiwen.com/subject/quualltx.html
网友评论