-4

I have an unordered list with dynamic contents that can be shown/hidden, with all the li having border-bottom except the last child.

However, with jquery's .hide() applied to the last child, the element is just given display:none, therefore making the visually last element still showing its border-bottom.

What's the best way to solve this, that is also reusable across other similar ul within the project?

1 Answers1

0

If you want to remove border-bottom of last 'li' element, then use following CSS:-

.classname:last-child{
    border-bottom:0;
}

Where classname is the class added to the 'li' element.

.hide() will hide the last 'li' element, not border.

Sabith
  • 1,628
  • 2
  • 20
  • 38