gpt4 book ai didi

html - 左边的图标有间距,但边框根据文本

转载 作者:行者123 更新时间:2023-11-28 13:12:37 25 4
gpt4 key购买 nike

如果我这样使用:

a{
background: url('path') no-repeat left center;
padding-left: 50px;
border-bottom: 2px dashed;
}

这会产生这样的结果:

enter image description here

但是如果我使用 margin-left: 50px; 这将产生这样的结果:

enter image description here

我怎样才能做到这样:

enter image description here

最佳答案

你的 HTML 必须是这样的

<a href="#"><span>some text</span></a>

因此您可以分别设置链接和文本的样式

a{
background: url('path') no-repeat left center;
padding-left: 50px;
}
a span {
border-bottom: 2px dashed;
}

关于html - 左边的图标有间距,但边框根据文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18569713/

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