I have an anchor element that is styled. This works fine until the anchor wraps onto the next line. Then it only applies that style to the vertical intersection of both lines. How can I apply the styling so it wraps on both lines?
a {
text-decoration: none;
word-wrap: break-word;
position: relative;
border: 1px black solid
}
a:hover::before {
bottom: 0;
height: 95%;
}
a::before {
content: '';
background: orange;
position: absolute;
left: 0;
bottom: 3px;
width: 100%;
height: 6px;
z-index: -1;
transition: all .3s ease-in-out;
}
<a href="">How can I apply the styling so it wraps on both lines?</a>
<br><br>
<a href="">How can I apply the styling so it wraps on both lines? How can I apply the styling so it wraps on both lines? How can I apply the styling so it wraps on both lines?</a>
2
Answers
Try this :-
Use gradient