We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
li { float: left; width: 50%; &:nth-child(odd):nth-last-child(-n+2):before { display: none; } &:nth-child(2n):after{ @include border(left); top: 13px; bottom: 13px; } }
li { &:not(:last-child) { /* 除了最后一个列表项的样式*/ } }
li:nth-child(4),li:nth-child(4)~li { /* 第四个项和其之后的所有列表项的样式 */ }
/* 定义mixin */ @mixin n-items($n) { &:first-child:nth-last-child(#{$n}), &:first-child:nth-last-child(#{$n}) ~ & { @content; } } /* 像这样使用 */ li { @include n-items(4) { /* 这里写样式 */ } }
li:first-child:nth-last-child(n+4), li:first-child:nth-last-child(n+4) ~ li { /* 目标列表选择最少包含四个列表项 */ }
li:first-child:nth-last-child(-n+4), li:first-child:nth-last-child(-n+4) ~ li { /* 选择列表项最多只有四个的列表所有子元素 */ }
li:first-child:nth-last-child(n+4):nth-last-child(-n+6), li:first-child:nth-last-child(n+4):nth-last-child(-n+6) ~ li{ /*选择包含2-6个列表项的列表所有子元素*/ }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
去掉两列列表最后的(偶数时最后两个,单数时是最后一个)的边框线
:not 选择器匹配非指定元素/选择器的每个元素。
第四个项和其之后的所有列表项
当且仅当有四个列表项时的样式
至少包含4个列表项时
最多只有4个列表项目时
选择包含4-6个列表项的列表所有子元素
The text was updated successfully, but these errors were encountered: