I need to create a sidebar with a bottom border after each li element, except the last one. However, I'm facing an issue with Bootstrap 4 where using border-0 removes all borders on list-group-items. I've tried editing it via CSS but can't seem to make it work as intended; only displaying one bottom border after the last li element.
Here is a preview image of what I am trying to achieve:
https://i.sstatic.net/7W0gC.png
Below is my code snippet:
.sidebar {
position: fixed;
z-index: 9999;
}
.menu {
position: fixed;
background-color: #fff;
height: 100vw;
width: 90px;
top: 60px;
overflow: hidden;
.list-group-item {
border: 0;
}
a {
color: gray;
font-size: 16px;
span {
white-space: nowrap;
}
}
}
.menu:hover {
width: 260px;
}
<div class="sidebar">
<ul class="list-group flex-column d-inline-block menu">
<li class="list-group-item py-2">
<a href="#">
<span class="align-middle"><img src="https://placehold.it/50x50" height="50" class="mr-4">Text</span>
</a>
</li> <!-- /.list-group-item -->
<li class="list-group-item py-2">
<a href="#">
<span class="align-middle"><img src="https://placehold.it/50x50" height="50" class="mr-4">Text</span>
</a>
</li> <!-- /.list-group-item -->
<li class="list-group-item py-2">
<a href="#">
<span class="align-middle"><img src="https://placehold.it/50x50" height="50" class="mr-4">Text</span>
</a>
</li> <!-- /.list-group-item -->
</ul>
</div> <!-- /.sidebar -->