【发布时间】:2019-01-12 00:06:29
【问题描述】:
我有一个这样的 html
<a href="https://twitter.com/@some-name-here" target="_blank" rel="noopener" class="social-icon twitter grayscale"></a>
这里真正发生的是我只是使用 css 类在 href 中显示图像:
.social-icon.twitter {
background: url('../images/logo-twitter.png') no-repeat center center;
}
我不能这样做<a....>Twitter</a>,因为在这种情况下显示的文本会破坏视图。
我想不出任何其他方法,比如在我的a 中添加一个带有文本的span 并将其隐藏,例如<a....><span class="hide">Twitter</span></a>,但想知道是否有任何合适的解决方案?
对此有什么建议吗?
【问题讨论】:
标签: html css lighthouse