skip to Main Content

How can I remove the border from last menu item?

I tried,

.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;
}

but no luck. my site is https://******.dk. (url removed)

I’m using elementor plugin, & also added a custom class “noborder” on the last menu item
enter image description here

3

Answers


  1. Use

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

    instead of

     .menu-item a:last-child
    

    You are looking for the last child li not the last child a

    Login or Signup to reply.
  2. a:last-child {
       border: none;
    }
    

    We don’t need border as the just last item will cover the border for us.

    Login or Signup to reply.
  3. Try to use :last-child selector.

    You will get a full description and tested way here , so that next time no worry anymore 🙂

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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search