gpt4 book ai didi

html - 在 HTML 省略号下划线

转载 作者:太空狗 更新时间:2023-10-29 15:46:29 24 4
gpt4 key购买 nike

我正在使用 text-overflow: ellipsis 来剪辑 anchor 内跨度内的文本。当我悬停时,省略号字符没有下划线,这会导致一个小间隙。有办法解决这个问题吗?

最佳答案

是的,您可以这样做 - 设置 text-decoration: none 而不是使用 border-bottom - DEMO

a {
display: block;
width: 185px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-decoration: none;

border-bottom: 1px solid transparent;
}

a:hover {
border-bottom: 1px solid #000;
}

关于html - 在 HTML 省略号下划线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12903766/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com