小编给大家分享一下css如何使用负的nth-child选择项目,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!
使用负的 nth-child 选择项目
在CSS中使用负的 nth-child 选择项目1到项目n。
li { display: none; } /* select items 1 through 3 and display them */ li:nth-child(-n+3) { display: block; }
看完了这篇文章,相信你对“css如何使用负的nth-child选择项目”有了一定的了解,如果想了解更多相关知识,欢迎关注云搜网行业资讯频道,感谢各位的阅读!