如何隐藏锚文本而不隐藏锚 [英] how do i hide anchor text without hiding the anchor

查看:272
本文介绍了如何隐藏锚文本而不隐藏锚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我有以下标记:

<li><a href="somehwere">Link text</a></li>

如果我在a标签上有背景图片,我该如何使用css隐藏链接文本? font-size:0似乎在一个标签除了在ie7小blobs显示工作正常。

If i have a background image on the a tag how would I hide the link text using just css? font-size:0 seems to work fine on the a tag apart from in ie7 little blobs show.

感谢


  • 感谢您的帮助iv used line-height:0 ;和font-size:0;和text-indent:-999px;但是它仍然在safari中显示一些blob,任何想法?

推荐答案

>

Try

 a{
    line-height: 0; 
    font-size: 0;
    color: transparent; 
 }



透明; 涵盖了Webkit浏览器仍然显示1px的文本的问题。


The color: transparent; covers an issue with Webkit browsers still displaying 1px of the text.

这篇关于如何隐藏锚文本而不隐藏锚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆