删除最后一个菜单项的边框

Removing border on last menu Item

如何删除最后一个菜单项的边框?

我试过了,

.elementor-1785 .elementor-element.elementor-element-8e7245e 
.elementor-nav-menu .menu-item a:last-child {
    color: #333333;
    background-color: #f0f0ed;
    border-style: solid;
    border-width: 0px 1px 0px 0px;
    border-color: #0274be;
}

但运气不好。我的网站是 https://******.dk。 (url 已删除)

我正在使用 elementor 插件,并且还在最后一个菜单项上添加了自定义 class "noborder"

使用

 .menu-item:last-child a{
     border-right: none;
 }

而不是

 .menu-item a:last-child

您要查找的是最后一个 child li 而不是最后一个 child a

a:last-child {
   border: none;
}

我们不需要边框,因为最后一项将为我们覆盖边框。

尝试使用 :last-child 选择器。

您将在此处获得完整的描述和测试方法,下次再也不用担心:)

https://www.w3schools.com/cssref/sel_last-child.asp