gpt4 book ai didi

CSS:最后类型且仅当偶数

转载 作者:太空宇宙 更新时间:2023-11-03 20:39:16 24 4
gpt4 key购买 nike

是否有可能使 CSS 选择器选择最后一个类型并且仅当它是偶数元素时才同时选择?

类似于:

.element:last-of-type:nth-of-type(even) {...}

最佳答案

这是一个选择...

li:last-of-type:nth-of-type(even) {
color: red;
}
<ol>
<li>1</li>
<li>2</li>
</ol>
<ol>
<li>1</li>
<li>2</li>
<li>3</li>
</ol>

关于CSS:最后类型且仅当偶数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28326093/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com