ie6下display:none的BUG
来源:互联网 发布:招商行情分析软件 编辑:程序博客网 时间:2024/06/09 23:36
今天同事给我看了一个display:none引起的3像素的BUG,非常奇怪!从来没碰到过display:none还能引起这种bug。
看代码:
<div style="width:300px; margin:20px; border:1px solid #000; overflow:hidden; zoom:1;">
<div style="background:green; width:10px; float:left; height:300px;"></div>
<div style="background:red; float:left; height:300px; width:280px;"></div>
<div style="display: none; "></div>
<div style="background:green; width:10px; float:left; height:300px;"></div>
</div>
这个是有在ie6下如图
其他浏览器如图:
解决方案1:将最后一个div加一个margin-right:-3px;即
<div style="width:300px; margin:20px; border:1px solid #000; overflow:hidden; zoom:1;">
<div style="background:green; width:10px; float:left; height:300px;"></div>
<div style="background:red; float:left; height:300px; width:280px;"></div>
<div style="display: none; "></div>
<div style="background:green; width:10px; float:left; height:300px;margin-right:-3px"></div>
解决方案2:将display: none的div换一个形式隐藏:即
<div style="width:100px; margin:20px; border:1px solid #000; overflow:hidden; zoom:1;">
<div style="background:green; width:10px; float:left; height:100px;"></div>
<div style="background:red; float:left; height:100px; width:80px;"></div>
<div style="position:absolute; visibility: hidden "></div>
<div style="background:green; width:10px; float:left; height:100px; margin-right:-3px"></div>
</div>
- 转:ie6下display:none的BUG
- ie6下display:none的BUG
- IE6,7 表格display:none导致表格错乱的问题
- 解决IE6下div table 使用display:none;隐藏时仍然占空白位置
- visibility:none 和 display:none的区别
- display:none和visibility:none的区别
- ie6.7设置display:none时仍占位
- IE6下DIV高度显示的Bug
- 关于ie6下iframe的高度bug
- IE6下DIV高度显示的Bug
- IE6下著名的z-index bug
- IE6下position:fixed的bug解决
- IE6下width:100%的BUG
- IE6下的CSS BUG枚举
- 一个IE6下重复加载的BUG
- IE6 下 jQuery 操作 select的BUG
- IE6下jQuery选中select的BUG
- li在ie6.7下的BUG
- 从Win32过渡到MFC
- Win7电脑蓝屏的一般解决办法
- Cursor的moveToFirst和moveToNext
- SIP代理服务器
- mysqldump命令详解
- ie6下display:none的BUG
- Ubuntu(乌班图)下mysql+tomcat+jdk+SSH的安装与配置
- 《程序员的第一年》---------- C# 在非web程序取目录笔记
- android 之猜拳游戏练习
- mysql group by、select和order by的特例
- data guard , primary, standy init.ora 备忘
- jdk,jre的关系
- Android优秀开源项目
- 开博了