段落标签与 IE7 中的 Meyer 重置冲突?
在处理一个相当小且简单的布局时,我决定使用 Meyer 的 CSS Reset 规则来消除浏览器之间的一些预期差异。 一切都运行得很好,直到我决定在几个嵌套的 div 中添加几个段落。
一旦我将段落标签放入第二个嵌套 div 中,父级和授予父级 div 的背景图像就会在 IE7 中消失。
删除段落标签(并使用未标记的文本)将返回背景图像。 此外,保留标签并删除对reset.css 文件的引用可以恢复背景图像。
显然我不想采用任何一种方法来解决这个问题。 这里有 CSS 专家知道发生了什么吗?
Working on a rather small, and simple layout, I decided to use Meyer's CSS Reset rules to clear some of the expected discrepancies between browsers. All was working fairly well until I decided to add a few paragraphs into a couple nested divs.
Once I placed the paragraph-tags within the second nested div, the background images of both the parent, and the grant parent divs vanished in IE7.
Removing the paragraph tags (and going with untagged-text) returns the background images. Additionally, leaving the tags and removing reference to the reset.css file restores the background images.
Obviously I don't want to go with either of those routes to solve this issue. Any CSS gurus here know what is taking place?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它看起来像是 IE 中内容消失错误的一个版本。
将 Zoom:1 添加到 div.pd_horiz_content 和 div.pd_horiz_content_b。 这将在 IE 中调用“hasLayout”,并且您的背景将会显示。
您还可以通过向 div 添加尺寸(宽度:960px)来调用 hasLayout。 这对于您的情况可能更有意义,因为您的 div 有基于背景图像的固定宽度。
It looks like a version of the disappearing content bug in IE.
Add zoom:1 to div.pd_horiz_content and div.pd_horiz_content_b. That will invoke 'hasLayout' in IE and your background will show up.
You can also invoke hasLayout by adding a dimension (width:960px) to the divs. This would probably make more sense in your case since your divs have a fixed width based on the background images.
奇怪的是,当我从
reset.css
文件中删除以下规则时,问题就解决了:background:transparent
此规则应用于第一个大块匹配元素,所以我不确定从长远来看它会产生什么影响。 希望有一个更好的解决方案,因为我对编辑 Meyers 的 reset.css 以“解决”我的问题有点不安。
Oddly enough, when I remove the following rule from the
reset.css
file, the issue is resolved:background:transparent
This rule is applied to the first large block of matched elements, so I'm not sure the implications it will have in the long run. Hopefully there's a better solution, as I'm a little uneasy about editing Meyers' reset.css in order to "fix" my problem.