简体   繁体   English

为什么该页面在IE,Firefox和Chrome之间不一样

[英]Why does this page look different between IE, Firefox & Chrome

Take a look at this html page . 看看这个html页面

In Firefox it looks just like I want it to look, in IE it looks "a bit weird", and in Chrome it's all twisted. 在Firefox中,它看起来就像我想要的样子;在IE中,它看起来“有点怪异”;在Chrome中,它们都扭曲了。

What non-standard HTML I am using that makes it looks so different between browsers? 我使用的是哪种非标准HTML,使其在浏览器之间看起来如此不同? Specifically, how can I fix the Chrome & IE versions to look more like Firefox? 具体来说,如何将Chrome和IE版本更像Firefox?

Note that Chrome only goes haywire if all or almost all columns have the yellow stickies. 请注意,只有在所有或几乎所有列都带有黄色胶粘物的情况下,Chrome才会陷入混乱。 If one or two columns are empty, then Chrome displays the page just like Firefox. 如果一两列为空,则Chrome会像Firefox一样显示该页面。

Edit - here is the fixed page . 编辑-这是固定页面

The page doesn't have a DOCTYPE. 该页面没有DOCTYPE。 It is important to have one to tell the browsers that your page is standards compliant. 重要的是要告知浏览器您的页面符合标准。 Start from there and ensure your page passes validation for your chosen DOCTYPE. 从此处开始,并确保您的页面通过了所选DOCTYPE的验证。

UPDATE: Good job on fixing the validation! 更新:做好验证工作! Your problem now is that the table element follows two floated divs without any clearing. 您现在的问题是,table元素跟随两个浮动div而没有任何清除。 You must clear the floated elements so that the following elements are laid out correctly below them. 您必须清除浮动元素,以便将以下元素正确布置在它们下面。

Try the following. 尝试以下方法。 Google "clearfix" for a more elegant solution. 谷歌“ clearfix”提供了更优雅的解决方案。

<div style="float:left">....
<div style="float:right">....
<br style="clear:both"/>
<table ....

One of the first things I'd have to suggest is making sure that your code is valid if you want cross-browser friendly. 我要建议的第一件事是,如果您希望跨浏览器友好,请确保您的代码有效。

The posted code comes up with 33 errors. 发布的代码带有33个错误。

FF isn't quite as picky as some other browsers can be, and gives a lot of leeway in terms of valid code. FF不像其他一些浏览器那样挑剔,并且在有效代码方面有很多回旋余地。

Try validating and fixing the problems with validity, then check it again; 尝试验证并纠正问题,然后再次检查; it might look at least a bit better. 它看起来至少好一点。

Try validating your CSS and HTML if possible. 如果可能,请尝试验证您的CSS和HTML。 That usually helps remove the biggest of glitches. 通常,这有助于消除最大的故障。

validator.w3.org validateator.w3.org

将日历表浮动到左侧

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

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