我有一个设置了样式的锚元素.在锚点换行到下一行之前,这种方法工作得很好.然后,它只将该样式应用于两条直线的垂直交点.我怎样才能在两条线上都包起来呢?
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>