大佬教程收集整理的这篇文章主要介绍了css – :not(:last-of-type)不适合上课,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
JSFiddle:http://jsfiddle.net/C23g6/589/
HTML:
<div class="comment">This is Red</div> <div class="Hello">------------------</div> <div class="comment">This is Red</div> <div class="Hello">------------------</div> <div class="comment">Shouldn't be Red</div> <div class="Hello">------------------</div>
CSS:
.comment:not(:last-of-typE) { color: red; }
与the first element of a class不同,没有办法使用纯CSS来匹配类的最后一个元素,甚至没有覆盖.您应该使用有关现有结构的信息来创建与您要查找的元素匹配的选择器,例如:
.comment:not(:nth-last-child(2))
或者如果没有,请在最后一个.comment中添加一个额外的类名,并将其排除,或以其他方式更改结构本身以满足您的需求.
以上是大佬教程为你收集整理的css – :not(:last-of-type)不适合上课全部内容,希望文章能够帮你解决css – :not(:last-of-type)不适合上课所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。