我对 css 不是很了解,如何从 css 中的最后一个 li 元素中删除 border-bottom。
ul li{
border-bottom: 1px solid blue;
}
最佳答案
您可以使用:last-child
伪类:
ul li:last-child {
border-bottom: 0;
}
这只适用于 IE9+。作为解决方法,您可以为列表项提供顶部边框并覆盖 :first-child
的值。 :
ul li {
border-top: 1px solid blue;
}
ul li:first-child {
border-top: 0;
}
关于html - 删除最后一个 li 边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29587152/