IE6的3像素BUG
来源:互联网 发布:杨幂网络暴力事例 编辑:程序博客网 时间:2024/04/28 14:32
IE6的3像素BUG
1. 什么事IE6的3像素BUG?下面我们做个试验:
代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//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>IE6的3像素BUG</title>
<style type="text/css">
div{background:#cccccc;}
#first{float:left;width:100px;height:100px;}
#second{clear:left;float:left;margintop:10px;width:100px;height:100px; }
#third{width:200px;margin-left:100px; height:310px; }
</style>
</head>
<body>
<div id="first"></div>
<div id="second"></div>
<div id="third"></div>
</body>
</html>
在IE6.0中:
在IE8.0中:
理论上左边部分也就是#first和#second宽度是100px, #third的margin-left:100px,显示应该是IE8.0中那样没有缝隙,但是IE6.0却不知道因为什么产生了一个3px的间距,这就是IE6的3像素BUG。
2. 如何解决IE6的3像素BUG?
代码如下:
div{background:#cccccc;}
#first{float:left;width:100px;height:100px;_margin-right:-3px;}
#second{clear:left;float:left;margin-top:10px;width:100px;height:100px;_margin-right:-3px;}
#third{width:200px;margin-left:100px; height:210px;_margin-left:97px;}
在IE6.0中:
在网络上也看到一些解决方案,一次尝试如下代码:
1)
#first{zoom:1;float:left;width:100px;height:100px;_margin-right:-3px;}
#second{zoom:1;clear:left;float:left;margin-top:10px;width:100px;height:100px;_margin-right:-3px;}
#third{width:200px;margin-left:100px; height:210px;}
2)
#first{_zoom:1;float:left;width:100px;height:100px;_margin-right:-3px;}
#second{_zoom:1;clear:left;float:left;margin-top:10px;width:100px;height:100px;_margin-right:-3px;}
#third{width:200px;margin-left:100px; height:210px;}
3)
#first{float:left;width:100px;height:100px;}
#second{clear:left;float:left;margin-top:10px;width:100px;height:100px;}
#third{zoom:1;width:200px;margin-left:100px;height:210px;_margin-left:97px;}
4)
#first{float:left;width:100px;height:100px;}
#second{clear:left;float:left;margin-top:10px;width:100px;height:100px;}
#third{_zoom:1;width:200px;margin-left:100px;height:210px;_margin-left:97px;}
5)
#first{float:left;width:100px;height:100px;_margin-right:-3px;}
#second{clear:left;float:left;margin-top:10px;width:100px;height:100px;_margin-right:-3px;}
#third{width:200px;margin-left:100px; height:210px;}
6)
#first{float:left;width:100px;height:100px;}
#second{clear:left;float:left;margin-top:10px;width:100px;height:100px;}
#third{width:200px;margin-left:100px;height:210px;_margin-let:97px;}
都不能够如愿以偿,如果哪位高手发现我的代码哪里有问题,还请多多指教,非常感谢!
3. 第二个元素也用float可以有效的避免IE6的3像素BUG
代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//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>IE6的3像素BUG</title>
<style type="text/css">
div{background:#cccccc;}
#first{float:left;width:100px;height:100px;}
#second{float:left;width:100px;height:100px;}
</style>
</head>
<body>
<div id="first"></div>
<div id="second"></div>
</body>
</html>
在IE6.0中:
1. 但是如果第二个元素不是float的,就会显示出IE6的3像素BUG:
#first{float:left;width:100px;height:100px;}
#second{margin-left:100px;width:100px;height:100px;}
- IE6的3像素bug
- IE6的3像素BUG
- IE6的3像素BUG
- IE6的3像素bug新解决办法
- 解决 IE6 3像素Bug
- DIV+CSS:IE6的3像素bug解决心得
- IE6的3像素BUG产生条件及解决方法
- ie6的3像素bug其实还有一层错误。
- li margin-bottom在IE6,7中底部3像素的BUG
- IE6 | IE7 li底部多出几像素bug
- IE6 3像素问题
- 浏览器兼容性经典问题(二) IE6 3像素bug问题
- 浏览器兼容性经典问题(二) IE6 3像素bug问题
- ie浏览器的3像素bug
- IE6的3px bug解决方法
- IE6的一個小bug
- IE6的极品bug
- ie6 的bug
- poj 2531
- C++与C添加标准库头文件的形式
- Jquery 分页
- 集合(TreeMap练习-字母出现的次数)
- POJ - 1135 Domino Effect (最短路 Dijkstra)
- IE6的3像素BUG
- zoj 3299 概率dp
- Web MVC简介
- POJ 1724 ROADS (搜索+剪枝)
- Android开发之日期、时间选择器(DatePicker和TimePicker)的功能和用法
- Pat(Advanced Level)Practice--1082(Read Number in Chinese)
- linux 进程前后台调度
- 集合(Map扩展)
- poj 1548