I successfully achieved the reverse of this by utilizing :after
and ::after
to extend my bottom border precisely 1.3rem
:
When I applied both :before
and :after
simultaneously, my element became distorted because they are arranged horizontally with display: flex
, flex-direction: row
, and align-items: center
.
This technique can be used to adjust width or height, or potentially any mathematical dimension modifications:
a.nav_link-active {
color: $e1-red;
margin-top: 3.7rem;
}
a.nav_link-active:visited {
color: $e1-red;
}
a.nav_link-active:after {
content: '';
margin-top: 3.3rem; // combined margin and height
height: 0.4rem; // should match active link margin
background: $e1-red;
margin-left: -$nav-spacer-margin;
display: block;
}
a.nav_link-active::after {
content: '';
margin-top: 3.3rem; // combined margin and height
height: 0.4rem; // should match active link margin
background: $e1-red;
margin-right: -$nav-spacer-margin;
display: block;
}
Apologies, this is presented in SCSS
; simply scale up the values by 10 and substitute variables with standard measurements.