本文介绍了Internet Explorer 7上绝对定位的父级中的百分比宽度子元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这里有我遗漏的东西吗? 除了基于像素的宽度 ,在上有没有简单的修复方法? 包含此内容的CSS规范中是否包含此? 需要具有定义的 width ,以像素或百分比表示。在Internet Explorer 7中,父元素 div 需要为子百分比定义 width 可以正常工作。 Is there something I'm missing here?
Is there an easy fix for this besides the pixel-based width on the
child?
Is there an area of the CSS specification that covers this?
我有一个绝对定位 div 包含几个孩子,其中一个是相对定位 div 。当我对子 div 使用基于百分比的宽度时,它会在 Internet Explorer 7 ,但不能在Firefox或Safari上。
我使用像素宽度,它的工作原理。
I have an absolutely positioned div containing several children, one of which is a relatively positioned div. When I use a percentage-based width on the child div, it collapses to '0' width on InternetExplorer7, but not on Firefox or Safari.
If I use pixel width, it works. If the parent is relatively positioned, the percentage width on the child works.
解决方案
The parent div needs to have a defined width, either in pixels or as a percentage. In InternetExplorer7, the parent div needs a defined width for child percentage divs to work correctly.
更多推荐
Internet Explorer 7上绝对定位的父级中的百分比宽度子元素
发布评论