怪异模式下absolutely在IE6/7中的Bug
2009-11-06 00:54
351 查看
绝对定位的元素其偏移量是相对于 absolute或者relative元素的,如果父元素是static,则继续寻找父父的元素是否是absolute或者relative的,直到body为止
示例里面父元素是static的,所以应该是相对于body定位的...
可以看到d02的位置相对于父元素d01,而不是body,去掉d01的overflow:hidden;后正常,或者加dtd,在标准模式下也正常!
建议大家尽量加doctype,标准模式下css正常发挥作用。
示例里面父元素是static的,所以应该是相对于body定位的...
<!----> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <mce:style><!-- *{ margin:0px; padding:0px; } #d30{ height:100px; } #d01{ background:red; width:500px; height:500px; overflow:hidden; position:static; } #d01 #d02{ background:yellow; width:200px; height:200px; position:absolute; top:100px; } --></mce:style><style mce_bogus="1"> *{ margin:0px; padding:0px; } #d30{ height:100px; } #d01{ background:red; width:500px; height:500px; overflow:hidden; position:static; } #d01 #d02{ background:yellow; width:200px; height:200px; position:absolute; top:100px; } </style> </head> <body> <div id="d30"></div> <div id="d01"> <div id="d02"></div> </div> </body> </html>
可以看到d02的位置相对于父元素d01,而不是body,去掉d01的overflow:hidden;后正常,或者加dtd,在标准模式下也正常!
建议大家尽量加doctype,标准模式下css正常发挥作用。
相关文章推荐
- 怪异模式下absolutely在IE6/7中的Bug
- IE6/7和IE8/9(怪异模式)浮动元素折行Bug
- IE6/7 and IE8/9(怪异模式)中form元素默认样式导致的bug
- 【IE6 Bug】IE6的怪异解析模式
- IE6/7 and IE8/9/10(IE7模式)依次隐藏具有absolute或relative的父元素和子元素后再显示父元素,子元素依然能显示bug
- IE6/7/8/9怪异模式和IE6标准模式中多余字符Bug
- js-ie在怪异模式下解析position的bug
- 浏览器Quirksmode(怪异模式)与标准模式
- [Fix Bug] 当模式为exact_fit的Popup弹出时背景不完全覆盖
- 微信公众平台开发模式网页的BUG
- 浏览器的标准模式与怪异模式
- S3C2440的七种模式之——未定义模式(去掉bl print1 bug解决)
- 浏览器的标准模式和怪异模式
- iOS调试Bug方式之——NSZombieEnabled(僵尸模式)
- IE10中的互操作性HTML5怪异模式
- JQuery在IE8兼容性视图模式下操作Select的Options的Bug
- 理解标准盒模型和怪异模式&box-sizing属性
- 设计模式之--Decorator模式、BUG和AOP
- doctype声明、浏览器的标准、怪异等模式
- Bug模式之写入的数据格式出错