我有一个样式化的锚元素。在锚绕到下一行之前,此操作一直正常工作。然后,它只将该样式应用于两条线的垂直交点。如何应用样式使其在两条线上换行?
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条答案
按热度按时间6ju8rftf1#
使用渐变
gupuwyp22#
试试这个:-