Have you tried this way?
.vertical-line { height: auto; /* Automatically adjusts to the height of its container */ width: 4px; /* Adjust the width as needed */ background-color: #007bff; margin-right: 1rem; align-self: stretch; /* Makes sure the line stretches to match the height of the container */ }