More Related Content Similar to 再回首重构 仲金龙(麦时) 20120426 (20) 再回首重构 仲金龙(麦时) 201204264. IE bug 数据
• 一般bug46个
• 与haslayout有关的5个
• 因属性不支持的6个
• 导致页面崩溃的1个
数据杢源:http://haslayout.net/css/
5. 我们可能对IE6双边距的认识
• 在同方向设置margin和float值,将导致边距双倍
• 对同方向对块级元素上设置margin和float值,将导致边
距双倍
6. 20 A 150 B 150 C
IE6:
40 A 160 B 150 C
8. 类似问题
• 文本设置height和line-height,且两者相等,某些浏览器无法垂直居中
16. line-height方法测试结果
• 标准模式下, 图片前后有回车符,仅IE6不行;
• 标准模式下, 图片前后无回车符, IE6&IE7不行;
• 接近标准模式 下,图片前后有回车符,仅IE7可以;
• 接近标准模式下, 图片前后无回车符,都不可以;
• 在两种模式下,2张图片并排放置,且其中1张的高度等于
父级容器高度,不管前后有无回车,全都可以。
23. hasLayout与BFC
Haslayout 块级格式化环境 (Blocking format context)
针对的浏览器 Win IE5.5/6/7 IE8+/FF/CH/SA..
触収条件 • float不为none •float不为none
•display: inline-block •display:设为‘inline-block’,‚table-cell‛或为
•position: absolute "table-caption"
•height: (除 auto 外任何值) •position为absolute或fixed
•width: (除 auto 外任何值) •overflow不为visible
•writing-mode(与父级相反)
•zoom: (除 normal 外任意值)
Ie7:
min-height: (任意值)
min-width: (任意值)
max-height: (除 none 外任意值)
max-width: (除 none 外任意值)
overflow: (除 visible 外任意值,仅用于块级元素)
overflow-x: (除 visible 外任意值,仅用于块级元素)
overflow-y: (除 visible 外任意值,仅用于块级元素)
position: fixed
26. 是否是必须的?
缺失反斜杠‚‛
如果父级元素设置height且overflow:hidden
27. • 两者采用不用的渲染引擎,且IE mac符合标准。
• IE mac上无hasLayout的概念
• IE win中设置width,height触収haslayout的方法对Ie
mac有不利影响
http://www.satzansatz.de/cssd/onhavinglayout.html
28. • 1997年,苹果电脑和微软同意将IE for Mac成为Mac OS的默认
浏览器。
• 2003年,苹果电脑开収自己 的浏览器Safari
• 2003年6月13日,微软宣布终止开収Internet Explorer for
Mac。
• 2005年12月31日,微软终止对IE for Mac的支援,
• 2006年1月31日,微软不再提供IE for Mac下载,其地位被
Safari取代。
http://zh.wikipedia.org/wiki/Internet_Explorer_for_Mac
30. BFC阻值外边距叠加
margin-top:10px
margin-top:10px
margin-top:10px
margin-top:10px
margin-bottom:10px margin-bottom:10px
margin-top:10px
margin-top:10px
32. Q&A
Thank You!
仲金龙
mail:timezhong@gmail.com
blog:www.wheattime.com
33. 参考资料
• http://www.sam-i-am.com/work/sandbox/css/mac_ie5_hack.html
• http://perishablepress.com/new-clearfix-hack/comment-page-1/#comments
• http://w3help.org/zh-cn/kb/010/
• http://w3help.org/zh-cn/causes/RX1001
• http://www.wheattime.com/images-tables-and-mysterious-gaps.html
• http://drupal.org/node/444228
• http://www.positioniseverything.net/easyclearing.html
• http://zh.wikipedia.org/wiki/Internet_Explorer_for_Mac#.E7.8D.A8.E6.9C.89.E7.89.B9.E6.
80.A7