替代位置:相对;对于溢出:自动; IE7 中的错误
我把内容安排如下:
<div id="thumbnails" style="width: 40px; overflow: auto;">
<div style="float:left; width: 20px;">content</div>
<div style="float:left; width: 20px;">content</div>
<div style="float:left; width: 20px;">content</div>
<div style="float:left; width: 20px;">content</div>
<div style="float:left; width: 20px;">content</div>
<div style="float:left; width: 20px;">content</div>
在 IE7 中,这显示为内容超出了可滚动框。任何地方的答案都是使#thumbnails位置:相对。我的问题是,#thumbnails 中的项目是脚本化的可拖动对象,可以通过绝对定位的元素的幽灵拖动到缩略图之外。如果父级定位为相对位置,则效果不会很好,因为现在绝对位置是相对于 #thumbnails 而不是 。有谁知道 IE7 bug 的替代解决方案吗?
I have content arranged thusly:
<div id="thumbnails" style="width: 40px; overflow: auto;">
<div style="float:left; width: 20px;">content</div>
<div style="float:left; width: 20px;">content</div>
<div style="float:left; width: 20px;">content</div>
<div style="float:left; width: 20px;">content</div>
<div style="float:left; width: 20px;">content</div>
<div style="float:left; width: 20px;">content</div>
In IE7 this shows up with the content running out of the scrollable box. The answer everywhere is to make #thumbnails position:relative. My problem is that the items in #thumbnails are scriptaculous draggables that drag outside of thumbnails with a ghost of the element that is positioned absolutely. This does not go over well if the parent is positioned:relatively because now the absolute positions are relative to #thumbnails and not the <body>
. Does anyone know an alternative solution to the IE7 bug?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你听说过这个烦人的 IE“hasLayout”属性吗? http://msdn.microsoft.com/en-us /library/bb250481(VS.85).aspx(引用一些msdn很伤人,我现在感觉很脏......)。不管怎样,尝试对你的容器应用“zoom: 1”:它可能会改善情况。唯一的问题:缩放属性仅适用于 IE,并且会在其他浏览器下的 css 日志中创建警告。
Have you heard about this annoying IE "hasLayout" property? http://msdn.microsoft.com/en-us/library/bb250481(VS.85).aspx (quoting some msdn hurts, I feel dirty now...). Anyway, try to apply "zoom: 1" to you container: it might improve the situation. Only issue: zoom property is IE only and will create a warning in your css logs under another browser.