I'm trying to add a vertical line to the left of the active menu item by giving it border-left: 4px
and padding-left: 50px;
. However, this causes the active link to no longer be positioned below all the other links. Can anyone suggest a different approach?
Additionally, is there a way to adjust the height of the vertical line created with border-left
?
body {
margin:0;
}
.side-menu {
color: #fff;
background-color: #aaa;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
width: 100px;
height: 200px;
}
.active {
border-left: 4px solid #000;
color: #000;
padding-left: 50px;
}
<section class="side-menu">
<div>LOGO</div>
<div>
<div class="active">Link 1</div>
<div>Link 2</div>
<div>Link 3</div>
<div>Link 4</div>
</div>
</section>