I am attempting to create a crossed-out line above the content of an a
tag for decorative purposes. The line should stretch across the entire width without intersecting with the actual text within the tag.
This is my desired outcome:
https://i.sstatic.net/G9L6G.png
This is my current progress:
a {
background: none;
}
a::after {
content: "";
border: 3px solid #000;
display: block;
position: relative;
top: -50%;
}
<a class="fw-bold" href="">Explore Services</a>
Here is the jsfiddle link for the code above https://jsfiddle.net/68fkvhcw/
Why does the use of relative positioning and negative margin not produce the desired result?