Within my navigation, I am segmenting each section with text and a horizontal line. This pattern repeats for every section, as demonstrated below:
.navSectionHeader {
font-size: 1em;
color: #fff;
margin-left: 5px;
margin-bottom: 10px;
font-family: "Roboto";
font-weight: 700 !important;
border-bottom: 2px solid #6c6c6c;
}
/*.navSectionHeader::after {
content: ' ';
display: block;
border: 2px solid;
border-color: #6c6c6c;
margin-left: 0px !important;
}*/
The problem arises when the text is positioned directly against the left edge of the containing div. It should have some space to the left while maintaining that the bottom border starts at 0px from the left. Whenever I adjust the position with margin-left: 5px;
, it also moves the border-bottom
along with it. I even tried utilizing ::after
by including !important
at the end, but without any success. Am I going about this in the wrong way? Apologies, as I am new to front-end development!
Edit: The section header is enclosed within a <span>
element if that has any impact.