Login
网站首页 > 文章中心 > Css

css 选取第N个标签元素声明样式的方法

作者:小编 更新时间:2023-06-06 09:47:07 浏览量:158人看过

css 选取第N个标签元素声明样式的方法

软件介绍:first-child first-child 表示选择列表中的第一个标签。last-child last-child 表示选择列表中的最后一个标签nth-ch...

first-child first-child 表示选择列表中的第一个标签。

last-child last-child 表示选择列表中的最后一个标签

nth-child(3) 表示选择列表中的第 3 个标签

nth-child(2n) 这个表示选择列表中的偶数标签

nth-child(2n-1) 这个表示选择列表中的奇数标签

nth-child(n+3) 这个表示选择列表中的标签从第 3 个开始到最后。

nth-child(-n+3) 这个表示选择列表中的标签从 0 到 3,即小于 3 的标签。

nth-last-child(3) 这个表示选择列表中的倒数第 3 个标签。


使用方法:


li:first-child{}


版权声明:倡导尊重与保护知识产权,本站有部分资源、图片来源于网络,如有侵权,请联系我们修改或者删除处理。
转载请说明来源于"土嘎嘎" 本文地址:http://www.tugaga.com/jishu/css/214.html
<<上一篇 2023-06-06
下一篇 >> 2023-06-06

相关推荐

编辑推荐

热门文章