IE7 中错误的浮动变形
这是测试页面,在 IE7 中看起来不同,而在 Firefox 和 Firefox 中则正常。歌剧。
看起来像FF& Oprah 对右边距足够了
.twoColLiqRtHdr #mainContent {
margin: 0 20px 0 10px;
}
,并相应地放置文本(文本填充侧边栏下的空间),而 IE 使用#sidebar 的左边框作为边距,因此,不使用该空间。
编辑:以下是精美图片中描述的全部内容:链接 .
请帮我解决它。
here's test page, which looks differently in IE7, while OK in Firefox & Opera.
Looks like FF & Oprah are adequate about
.twoColLiqRtHdr #mainContent {
margin: 0 20px 0 10px;
}
right margin and place text accordingly (text fills space under sidebar), while IE uses #sidebar's left border as margin, and, as a result, that space is not used.
Edit: here's what it's all about described in nice picture: link.
Please, help me fix it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从
#mainContent
中删除zoom: 1
。我知道您首先添加它是为了解决 IE 错误,但如果您还希望主要内容围绕浮动,您将必须找到另一种方法来做到这一点。也许您可以将其添加到主要内容中的选择元素。
请参阅著名文章“<”中标题为“浮动元素旁边的元素”的段落a href="http://www.satzansatz.de/cssd/onhavinglayout.html" rel="nofollow noreferrer">关于布局”。
Remove the
zoom: 1
from the#mainContent
.I know you added that to work around IE bugs in the first place, but you're going to have to find another way to do that if you also want the main content to wrap around the float. Perhaps you can add it to select elements inside the main content.
See the paragraph titled "Elements next to floats" in the famous article "On having layout".
您是否尝试过将
#sidebar1
的边距调整为 0,尤其是底部?或者向左浮动而不是向右浮动?看,我不是 IE 的 CSS 黑客专家,但这可能会让你看到错误来自哪里。
当涉及到 IE7 时,可能会使用我一直以来最喜欢的 css-hack,有时它会给我带来奇迹:
Have you tried adjusting the
#sidebar1
's margin to 0, especially at bottom? Or floating it left instead of right?See, I'm not a crack in CSS-hacking for IE but probably this will enable you to see were the error is coming from.
Probably use my all-time favorite css-hack when it comes to IE7, sometimes it does wonders to me: