简体   繁体   English

IE8 是否有像 6 或 7 这样的渲染错误?

[英]Does IE8 have rendering bugs like 6 or 7?

Does IE8 have rendering bugs like IE6 or IE7? IE8 是否有像 IE6 或 IE7 那样的渲染错误? If I make my site render correctly in Firefox 3.5, will it look the same in IE8, or will additional changes / hacks / etc be needed?如果我让我的网站在 Firefox 3.5 中正确呈现,它在 IE8 中看起来是否相同,或者是否需要其他更改/黑客/等?

I want to make my site IE8 compatible.我想让我的网站兼容 IE8。 Do I need to do something extra for that?我需要为此做一些额外的事情吗?

Update: 6 march 2010更新:2010 年 3 月 6 日

Is there a possibility that I will have to add conditional CSS for IE8 or not?是否有可能我必须为 IE8 添加条件 CSS?

All browsers have their various quirks and no browser is guaranteed to display or act the same as another.所有浏览器都有其各种怪癖,没有任何浏览器可以保证显示或行为与另一个浏览器相同。 While W3C is making great strides to expand the functionality that should be standardized, many RFCs are not yet to the Recommendation stage , which is the stage that means it will no longer change and are more likely to be acceptable standards to develop on.虽然 W3C 在扩展应该标准化的功能方面取得了长足的进步,但许多 RFC 还没有到推荐阶段,这意味着它不会再改变并且更有可能成为可接受的标准进行开发。 Because of this, it is imperative that you ensure your site works in, at minimum, the browsers within your focus group .因此,您必须确保您的网站至少在您的焦点小组内的浏览器中工作

First, use reset.css or normalize.css .首先,使用reset.cssnormalize.css Both try to serve the same goal (consistency fixes between browsers), but each attacks the problem from different angles.两者都试图服务于相同的目标(浏览器之间的一致性修复),但每个人都从不同的角度解决问题。 So make sure you choose the one that works best for you.因此,请确保选择最适合您的那一款。 While not perfect, they get pretty darn close in all browsers, which is more than you can say without it.虽然不完美,但它们在所有浏览器中都非常接近,这比没有它你所能说的要多。

Second, check out QuirksMode to see the various browser compatability with standards (whether those standards are in recommended stage or not).其次,查看QuirksMode以查看各种浏览器与标准的兼容性(这些标准是否处于推荐阶段)。 This is where you can decide on the features you will use that match the compatibility with your focus group.您可以在此处决定将使用的功能与您的焦点小组的兼容性相匹配。

Third, with your new power of a 'consistent' css base, and knowledge of what browsers support what, be sure to read, embrace, preach, and apply progressive enhancement techniques (see articles I like on it below).第三,有了“一致”CSS 基础的新力量,以及浏览器支持什么的知识,一定要阅读、拥抱、宣扬和应用渐进增强技术(请参阅下面我喜欢的文章)。 The power of progressive enhancement is to use what does work instead of trying to shoehorn a fat foot into a slim shoe.渐进增强的力量是使用有效的方法,而不是试图将肥脚硬塞进细长鞋。

Articles on progressive enhancement:关于渐进增强的文章:

  1. http://www.alistapart.com/articles/understandingprogressiveenhancement http://www.alistapart.com/articles/understandingprogressiveenhancement
  2. http://www.alistapart.com/articles/progressiveenhancementwithcss http://www.alistapart.com/articles/progressiveenhancementwithcss
  3. http://en.wikipedia.org/wiki/Progressive_enhancement http://en.wikipedia.org/wiki/Progressive_enhancement

Lastly, install any other browsers that you consider in your focus group.最后,安装您在焦点小组中考虑的任何其他浏览器。 Doing so will allow you to test, without question, the appearance on the page.这样做将允许您毫无疑问地测试页面上的外观。

On windows, I recommend installing IE9 to be able to switch rendering modes to older versions of IE.在 Windows 上,我建议安装 IE9 以便能够将渲染模式切换到旧版本的 IE。 While these rendering modes are not perfect, in most cases they can be just as reliable as the real thing.虽然这些渲染模式并不完美,但在大多数情况下,它们可以和真实的东西一样可靠。 If you cannot install IE9, I feel sorry for you, but, luckily, IE8 gives you similar power for rendering modes.如果您无法安装 IE9,我为您感到抱歉,但幸运的是,IE8 为您提供了类似的渲染模式功能。

On anything else (or even windows if you want the real IE browsers rather than emulation), you need to get a windows virtual instance running.在其他任何东西上(如果你想要真正的 IE 浏览器而不是模拟,甚至是 windows),你需要运行一个 windows 虚拟实例。 There are many ways to get then and MS even provides various images of instances specifically for developers to be able to test old versions of IE.有很多方法可以获得,MS 甚至专门为开发人员提供各种实例图像,以便能够测试旧版本的 IE。 See this blog post for more details on where to get the MS supplied IE6 and IE7 VPCs.有关从何处获取 MS 提供的 IE6 和 IE7 VPC 的更多详细信息,请参阅此博客文章

Using these tools you should be more than able to develop a design that will look -- no -- work and degrade gracefully in 100% of browsers and validate that it is implemented correctly.使用这些工具,您应该能够开发出一种设计,它看起来——不——在 100% 的浏览器中正常工作和降级,并验证它是否正确实现。 While it can be a bit daunting, this will greatly reduce the chance of display/js related bug upon release.虽然它可能有点令人生畏,但这将大大减少发布时与 display/js 相关的错误的机会。

Yes, IE 8 still has some rendering bugs.是的,IE 8 仍然存在一些渲染错误。 Most of them are fixed, but I think that these for example are still there:它们中的大多数都是固定的,但我认为例如这些仍然存在:

  • The text-align attribute is applied to block elements, not just inline elements. text-align 属性应用于块元素,而不仅仅是行内元素。

  • Content of elements is still one character high even if there is no content.即使没有内容,元素的内容仍然高一个字符。

Of course it also depends on what doctype you are using.当然,这也取决于您使用的文档类型。 Without a proper doctype the page renders in quirks mode, which pretty much throws the browser back to IE 4.如果没有正确的文档类型,页面会以 quirks 模式呈现,这几乎会将浏览器抛回 IE 4。

If you are using different style sheets for different browser/version combinations, you will need another one.如果您为不同的浏览器/版本组合使用不同的样式表,您将需要另一个。 IE 8 doesn't behave exactly as any other browser or IE version. IE 8 的行为与任何其他浏览器或 IE 版本不同。 I always use a single style sheet for all browsers, and I didn't have to make any changes at all to it to make it work for IE 8.我总是为所有浏览器使用一个样式表,我根本不需要对其进行任何更改即可使其适用于 IE 8。

Expanding on @Kevin's and @James' answers, another good resource is Browser Shots to get screen captures of your site on different browsers and platforms.扩展@Kevin 和@James 的答案,另一个很好的资源是浏览器截图,可以在不同的浏览器和平台上获取您网站的屏幕截图。 Very useful for testing browsers/versions that you don't have access to, especially for tricky CSS layouts.对于测试您无法访问的浏览器/版本非常有用,尤其是对于棘手的 CSS 布局。

I've used it to view output for Mac and Linux browsers since I work in a Windows-only shop.自从我在 Windows 商店工作以来,我就用它来查看 Mac 和 Linux 浏览器的输出。

Note that the URL must be externally accessible;请注意,该 URL 必须可从外部访问; if you're developing on your local box you'll need to poke a hole through your firewall and maybe setup a dynamic DNS name instead of an IP address.如果您在本地机器上进行开发,则需要在防火墙上戳一个洞,并且可能设置一个动态 DNS 名称而不是 IP 地址。

Edited I moved one paragraph and rewrote it based on some feedback.编辑我移动了一段并根据一些反馈重新编写了它。

If you explore http://quirksmode.org you will find compatibility pages that explain the differences between various browsers, including Firefox 3.5 and IE8.如果您浏览http://quirksmode.org,您将找到解释各种浏览器(包括 Firefox 3.5 和 IE8)之间差异的兼容性页面。

Most likely you will be making changes, but that will depend on what you are using, as there are many similarities, that won't require changes.您很可能会进行更改,但这取决于您使用的内容,因为有许多相似之处,不需要更改。

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

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