假设我有这个元素用于显示网站徽标:
<div id="web-title">
<a href="http://website.com" title="Website" rel="home">
<span>Website Name</span>
</a>
</div>
将#web-title
被设置样式background:url(http://website.com/logohere.png)
,但如何正确隐藏文本Website Name
?如此处所示:使用 css 隐藏文本或此处https://stackoverflow.com/a/2705328,我已经看到了各种隐藏文本的方法,例如:
#web-title span { text-indent: -9999px; }
或者
#web-title span { font-size: -9999px; }
或者
#web-title span { position: absolute; top: -9999px; left: -9999px; }
我还看到一些结合了这三种方法。但实际上哪一个是有效隐藏文本的最佳实践?