首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

CSS图片映射,IE和FF不兼容有关问题

2012-03-27 
CSS图片映射,IE和FF不兼容问题代码:!DOCTYPEhtmlPUBLIC-//W3C//DTDXHTML1.0Transitional//EN http://w

CSS图片映射,IE和FF不兼容问题
代码:
<!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=gb2312 "   />
<title> 无标题文档 </title>
<style   type= "text/css ">
#pic{
width:400px;
height:300px;
position:relative;
}
#pic   ul{
margin:0px;
height:0px;
list-style-type:none;
}
#pic   a{
position:absolute;
color:#000;
display:block;
text-decoration:none;
width:100px;
height:100px;
border:1px   solid   #00ff00;
}
#pic   a:hover{
border:1px   solid   #ff0000;
}
#pic   .one   a{
top:15px;
left:20px;
}
#pic   .two   a{
top:86px;
left:182px;
}
#pic   .three   a{
top:208px;
left:237px;
}
</style>
<script   type= "text/javascript ">
</script>
</head>
<body>
<div   id= "pic ">
<img   src= "test.jpg "   width= "400 "   height= "300 "   border= "0 "   />
<ul>
<li   class= "one "> <a   href= "# "> 第一个热点 </a> </li>
<li   class= "two "> <a   href= "# "> 第二个热点 </a> </li>
<li   class= "three "> <a   href= "# "> 第三个热点 </a> </li>
</ul>
</div>
</body>
</html>

注:
测试时请注意图片地址
问题:
链接块的空处(无文字处)在IE6.0中为什么点击无效,怎么解决?
FF中正常

[解决办法]
给a加个背景
#pic a{
background:#fff;
position:absolute;
color:#000;
display:block;
text-decoration:none;
width:100px;
height:100px;
border:1px solid #00ff00;
}

[解决办法]
方法可以如楼上所说!
[解决办法]
改变下zIndex值就可以了。。
storm0(飘零雾雨.闻弦歌而知雅意,顾叶落而晓秋至)
code修改如下。。

<!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=gb2312 " />
<title> 无标题文档 </title>
<style type= "text/css ">
#pic{
width:400px;
height:300px;
}
#pic img {
border:none;
width:400px;
height:300px;
position:absolute;
z-index:1;
}
#pic ul {
margin:0;
height:0;
list-style:none;
position:absolute;
z-index:2;
}
#pic a {
position:absolute;
text-decoration:none;
width:100px;
height:100px;
border:1px solid #00ff00;
}
#pic a:hover {
border:1px solid #ff0000;
}
#pic .one a {
top:15px;
left:20px;
}
#pic .two a {
top:100px;
left:150px;
}
#pic .three a {


top:180px;
left:277px;
}
</style>
</head>
<body>
<div id= "pic ">
<img src= "20063794028457.jpg " alt= "测试 " title= "测试 " />
<ul>
<li class= "one "> <a href= "# "> 第一个热点 </a> </li>
<li class= "two "> <a href= "# "> 第二个热点 </a> </li>
<li class= "three "> <a href= "# "> 第三个热点 </a> </li>
</ul>
</div>
</body>
</html>

热点排行