简体   繁体   English

IE6中的正文内容div对齐问题

[英]Body Content div Alignment Problems In IE6

I am having alignment problems with a website I'm designing on IE6. 我在IE6上设计的网站存在对齐问题。 It works great in all browsers (Firefox, Opera, Chrome, Safari, etc.) including IE7, IE8 and IE9. 它在包括IE7,IE8和IE9在内的所有浏览器(Firefox,Opera,Chrome,Safari等)中都可以正常运行。 Basically, I troubleshooted and found that there is 25 extra pixels that are being added to either the main body of the page or the right body column of the page (these are divs #body_box or #right_box in the JS Fiddle below). 基本上,我进行了故障排除,发现页面的主体或页面的右主体列中添加了25个额外的像素(这些像素是下面的JS小提琴中的divs #body_box或#right_box)。 They should be displayed inline but instead the #right_box overlaps and is displayed underneath #body_box and floating to the right. 它们应内嵌显示,但#right_box重叠并显示在#body_box下方并向右浮动。

The way I know this is that I expanded the div #Complete_Layout to 1025px (as opposed to the 1000px that it's set at now) and that's when it worked in IE6. 我知道的方式是将div #Complete_Layout扩展到1025px(而不是现在设置的1000px),并且它在IE6中起作用。 I tried 1026px and 1024px and it didn't line up. 我尝试了1026px和1024px,但没有对齐。 I checked the dimensions of the background images which are accurate and I even attempted to change the width of the two divs (body_box and right_box) to percentages (75% and 25%) but it gave the same result. 我检查了背景图像的尺寸是否准确,甚至尝试将两个div的宽度(body_box和right_box)更改为百分比(75%和25%),但结果相同。 I'm out of ideas on what else to try. 我没有其他尝试的主意。

http://jsfiddle.net/cRcXq/ http://jsfiddle.net/cRcXq/

It should be noted that I am doing this in PHP and the body_box and right_box sections are part of include files (don't know if that changes anything). 应当指出,我是在PHP中执行此操作的,body_box和right_box部分是包含文件的一部分(不知道是否会发生任何变化)。 I've added a comment on the HTML of the JSFiddle on where index.right.php begins. 我在JSFiddle的HTML上添加了index.right.php起始位置的注释。 Thanks for the help. 谢谢您的帮助。

This looks like the infamous " IE 6 box model bug ," a well-known difference between IE 6 and other browsers from the time. 这看起来像臭名昭著的“ IE 6盒模型错误 ”,这是IE 6与当时其他浏览器之间的众所周知的区别。 Essentially, IE 6 counts the padding and the border as part of the width and height of an element, but any other browser from that time follows the same model as newer browsers. 实质上,IE 6将填充和边框视为元素的宽度和高度的一部分,但是从那时起,任何其他浏览器都采用与较新的浏览器相同的模型。

Seriously, though, why are you designing a website for IE 6? 认真地说,为什么要为IE 6设计一个网站? It's ten years old and insecure, and it has less than 1% market share in the US. 它已有10年历史,而且没有安全保障,在美国的市场份额还不到1%。 Microsoft has put up a website devoted to getting people off of IE 6. You wouldn't write code for Office 2000, or Mac OS 9, or PHP 3, so why are you developing code for a browser that was popular around the same time as those products? 微软已经建立了一个致力于使人们摆脱IE 6 的网站 。您不会为Office 2000,Mac OS 9或PHP 3编写代码,所以为什么要为同时流行的浏览器开发代码?作为那些产品?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM