IE6bug整理(hover a:hover) IE6 a:hover 无效

本文详细介绍了在使用IE6浏览器时遇到的a:hover背景消失的问题,并提供了一个解决办法:通过在:hover伪类中添加zoom:1和padding:0来确保背景图像的正确显示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

IE6bug整理(hover a:hover span)

ie6 a:hover span
今天在项目中遇到了这样的一个怪事,IE6 a:hover 背景不消失
最后找到了解决办法,对hover加上    #tabs1 a:hover {zoom:1; padding:0}

  1. <title>ie6 a:hover span bug</title>
  2. <style type="text/css">
  3. <!--
  4. body {
  5.     margin:0;
  6.     padding:0;
  7. }
  8. img {
  9.     border: none;
  10. }
  11.  
  12. #tabs1 a span {
  13.     display:block;
  14.     background:url("1.jpg") no-repeat;
  15.     width:110px; height:30px;
  16. }
  17. #tabs1 a:hover {zoom:1; padding:0}
  18. #tabs1 a:hover span {
  19.     background:url("2.jpg") no-repeat 
  20. }
  21. -->
  22. </style>
  23. </head>
  24. <body>
  25. <div id="tabs1">
  26. <a href="#"><span>&nbsp;</span></a>
  27. </div>
  28. </body>
  29. </html>


  补充:IE6 如果要a:hover (鼠标移上去)有效,href必须不为空;


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值