IE6 - 背景图像丢失,标题中有多余像素,大多数内容偏离中心
我的 WordPress 网站在 IE6 中正确显示时遇到重大问题。
链接到下面的屏幕截图。 我的背景图像丢失了,导航被减少了一些额外的像素,而且我的大部分内容都偏离了中心。
www.genevarealtytrust.com/content/wp-content/themes/wp-terra-basic/images/ie6_wpterra.jpg
FF 屏幕截图(链接如下)就是它应该的样子。 已经在 Safari、几个版本的 Firefox 和 IE7 中尝试过,所有的看起来都与预期的一样。 IE6 是唯一给我带来麻烦的。
www.genevarealtytrust.com/content/wp-content/themes/wp-terra-basic/images/ff_wpterra.jpg
有什么想法吗?
链接:www.genevarealtytrust.com/content
我已经验证了我的代码,并尝试了一些方法,但没有成功。
帮助! 欣赏它!
Having major issues getting my wordpress website to display correctly in IE6.
Link to screenshot below. My background image is missing, the nav is knocked down a few extra pixels, and most of my content is off center.
www.genevarealtytrust.com/content/wp-content/themes/wp-terra-basic/images/ie6_wpterra.jpg
FF screenshot (linked below) is what it should look like. Have tried in Safari, a couple versions of Firefox, and IE7, and all look just the way that they are supposed to. IE6 is the only one giving me trouble.
www.genevarealtytrust.com/content/wp-content/themes/wp-terra-basic/images/ff_wpterra.jpg
Any ideas??
Link: www.genevarealtytrust.com/content
I've validated my code, and have tried a few things, but no success.
Help! Appreciate it!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以尝试使用条件样式。 在文档的 head 部分粘贴:
现在您可以开始编辑 ie.css,而不必担心破坏其他浏览器的设计。
导航周围的额外空间:IE 有时具有与其他浏览器不同的默认边距/填充。 尝试
在新的 css 中显式定义。
没有背景:也许是对齐的原因。 尝试在背景图像定义中添加“左上角”之类的内容。 示例:
内容居中:在 CSS 中,有两种方法可以使内容居中。 第一:设置父元素text-align属性为center;。 第二:定义宽度并将边距设置为top-bottom-margin-value auto;。 示例:
我希望这将有助于解决您的任何问题:)
You can try using conditional styles. In document's head section paste:
Now You can start editing ie.css without worrying about spoiling design for other browser.
Extra space around nav: IE sometimes has default margins/paddings different from other browsers. Try defining
explicitly in Your new css.
No background: Maybe it's the alignment. Try adding somethig like "top left" to Your background-image definition. Example:
Content centering: In CSS there are two ways to center content. First: setting the parent element text-align property to center;. Second: Defining width and setting margin to top-bottom-margin-value auto;. Example:
I hope this will help solve any of Your problems :)
这并不是您问题的真正答案(因为我没有足够的代表来发表评论:)),但请尝试运行 此列表常见 IE CSS 错误。 它帮助我解决了 CSS 中的一些问题,但 IE 6 是一个战区。 否则,我真的建议您阅读这本精彩的书防弹网页设计。
This isn't really an answer to your question (and since I don't have enough rep to comment :) ), but try running through this list of common IE CSS bugs. It's helped me work out some kinks in my CSS, but IE 6 is a warzone. Otherwise, I'd really suggest getting the fantastic book Bulletproof Web Design.
谢谢提醒伙计! Daveslab,我一定会把这份清单放在手边,并感谢您推荐这本书。
居中问题/缺少背景图像:
我制作了备用 css 文档,这给了我更多的实验空间 - 我能够通过稍微简化 CSS 来解决有问题的 CSS 缺失和居中问题部分通过反复试验。 (删除了浮动、位置...)
额外像素:
最终修复了标题底部的 3 个像素...真是太愚蠢了。
显然 IE6 在标题图像的底部应用了额外的 3 个像素,因为该 div 的 html 代码被分成 3 行...
我只需将它们全部组合成一行,底部的额外填充就消失了。 愚蠢...(而且丑陋)
我在右侧仍然有一个额外的像素,我正在尝试解决它 - 仍在调查。
Thanks for the tips guys! Daveslab, I'll definitely keep that list handy, and thanks for the book recommendation.
Centering Issue/Missing Background Image:
I made the alternate css doc and that gave me more room to experiment - I was able to resolve the missing background image and centering issue by simplifying the CSS a bit for the problematic section by trial and error. (removed float, position...)
Extra pixels:
What finally ended up fixing the 3 pixels on the bottom of my header was... just stupid.
Evidently IE6 was applying an extra 3 pixels to the bottom of the header image because my html code for that div was split into 3 lines...
I just had to combine them all into one line, and the extra padding on the bottom disappeared. Dumb... (and ugly)
I still have an extra pixel on the right side that I'm trying to resolve - still investigating.