Earid
Earid

Reputation: 842

Removing border on last menu Item

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

Upvotes: 0

Views: 1287

Answers (3)

Ashik Mahmud
Ashik Mahmud

Reputation: 127

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

Upvotes: 1

Mercurial
Mercurial

Reputation: 3885

a:last-child {
   border: none;
}

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

Upvotes: 1

Gildas.Tambo
Gildas.Tambo

Reputation: 22653

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

Upvotes: 2

Related Questions