我想用菜单栏上的链接显示图像。我的代码如下:在CSS如何使用CSS将图像添加到锚标签?
<a href="#" class="login" title="Login"></a>
登录类是如下:
.login{background: url(../img/user.png) no-repeat 6px center;}
但是,我不能够在浏览器中查看图像。如果我尝试像
<a href="#" class="login" title="Login">Login</a>
然后图像出现在背景中。但我只想使用图像而不是文字。我怎样才能做到这一点?
删除文本,并定义一个'width'。或者使文本透明:'color:transparent'。 –
@ŠimeVidas:...怎么样?我是一个完整的noob..please解释 –