谷歌和火狐浏览器下测试是正常的,IE下鼠标移过logo是没有超链接的提示的

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
*{ padding:0; margin:0;}
.logo{ position:relative; width:270px; height:129px; margin:50px auto;}
.logo img{ display:block; border:none;}
.logo a{ position: absolute;left: 30px;top: 35px;width: 200px;height: 60px;display: block;}
</style>
</head>

<body>
<div class="logo">
<img src="http://www.baidu.com/img/bdlogo.gif" alt="" />
<a title="其实我是360搜索" href="http://www.so.com"></a>
</div>
</body>
</html>

修复ie下的bug:

方法一:给a标签加一个透明的背景图片,然后再给背景设置透明;缺点影响效率;

方法二:给a标签加一个无效的背景图片链接,缺点多了一个http请求;.logo a{ position: absolute;left: 30px;top: 35px;width: 200px;height: 60px;display: block; background:url(blank);}

 

 

相关文章:

  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
  • 2021-09-23
猜你喜欢
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
相关资源
相似解决方案