我的问题是使用伪代码时,:last-child
我想到了li
包含E
由样式的影响,但它是最后li
在.subNav
其中受到影响。
我已经尝试过这些(下),但是没有任何效果。
nav ul:first-child li:last-child {border: none;padding-right: 0;}
nav ul:not(.subNav) li:last-child {border: none;padding-right: 0;}
如何获得主线ul
的最后li
影响?
最后一个li之后有一个div。因此,它不是最后一个孩子。您可以:last-of-type
用来定位最后一个li:
nav ul li:last-of-type {border: none;padding-right: 0;}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句