返回顶部

收藏

使用 CSS 将链接文本替换成图片

更多

这是用来显示LOGO的好方法

<h1><a href=\"./\" title=\"Return Home\"><span></span>Home</a></h1>

#header h1 a{
    display:block; /* Required */
    width:250px; /* Width of image in question */
    height:70px; /* Height of image in question */
    position:relative; /* Required */
}
#header h1 a span{
    position:absolute; /* Required */
    width:100%; /* Stretch full width of parent */
    height:100%; /* Stretch full height of parent */
    background:url(images/logo.gif) top left no-repeat; /* Image */
    cursor:pointer; /* Required for links to appear like links in IE */
}
//该片段来自于http://outofmemory.cn

标签:css,网页设计

收藏

0人收藏

支持

0

反对

0

»更多 您可能感兴趣的代码
  1. 2014-05-26 19:43:07Clearfix CSS Hack by amaker8
  2. 2014-05-27 16:54:23纯css做圆角 by GauSir
  3. 2014-07-17 13:33:45CSS清除浮动Clearfix by 冬夜微风
  4. 2014-08-29 13:23:56CSS Box Shadow by 奔小康
  5. 2014-09-10 13:03:12只能让IE6识别的css by init0
  6. 2014-11-10 21:21:18CSS3动画-播放黑胶唱片 by init0
  7. 2014-05-25 19:09:21关于CSS控制打印Table by 龙堂修罗
  8. 2014-05-26 16:08:28很炫的CSS3导航效果(会动的哦^_^) by tsl0922
  9. 2014-05-26 19:49:44CSS:解决跨浏览器兼容性 by starstroll
  10. 2014-05-27 17:07:34CSS兼容浏览器实现圆角 by amaker8
  11. 2014-07-13 12:53:47自己常用的CSS Reset by 奔小康