gpt4 book ai didi

html - 为超链接显示图像而不是文本

转载 作者:可可西里 更新时间:2023-11-01 14:56:52 26 4
gpt4 key购买 nike

如何为超链接显示图像而不是文本?请看我的例子,在这里你可以看到文字“x”和背景图片。我只想显示超链接的背景图像。

http://jsfiddle.net/8rfyT/

最佳答案

.cancel {
background: url(http://www.softicons.com/download/web-icons/light-grey-square-icons-by-axialis-team/png/16/Cancel.png) center no-repeat;
text-indent: -9999px;
display: block;
width: 16px;
height: 16px;
}

制作链接display: block; 这样你就可以给它背景图片的宽度和高度,然后使用text-indent 来隐藏实际的文本

Your fiddle updated

关于html - 为超链接显示图像而不是文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6491633/

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