# css 如何匹配前N个子元素及最后N个子元素
Issue
欢迎在 Issue 中交流与讨论: Issue 369 (opens new window)
Author
见 【Q307】如何实现表格单双行条纹样式 (opens new window)
- 如何匹配最前三个子元素:
:nth-child(-n+3)
- 如何匹配最后三个子元素:
:nth-last-child(-n+3)
Issue
欢迎在 Issue 中交流与讨论: Issue 369 (opens new window)
Author
见 【Q307】如何实现表格单双行条纹样式 (opens new window)
:nth-child(-n+3)
:nth-last-child(-n+3)