如何选中相同class类名下最后一项?
如题 想给同一个class类名下最后一项的border去掉 请问如何实现
如题 想给同一个class类名下最后一项的border去掉 请问如何实现
你可以试试 .mylast:last-of-type
示例代码:
<style>
.mylast:last-of-type
{
background:#ff0000;
}
</style>
<h1>This is a heading</h1>
<div class="mylast">The first paragraph.</div>
<div class="mylast">The second paragraph.</div>
<div class="mylast">The third paragraph.</div>
<div class="mylast">The fourth paragraph.</div>