“修复 Internet Explorer”样式表

发布于 2024-12-27 10:22:13 字数 363 浏览 0 评论 0 原文

我有一个专门使用 Firefox 9 开发和测试的网站。在这个版本的 Firefox 中查看时,我对布局/样式非常满意。我现在面临着一项艰巨的任务,即使其在 IE7+ 中显示同样好(或尽可能接近)(我不支持 IE6)。当然,我也希望它能够在 Chrome 和 Chrome 中良好地显示。 Safari,但我认为他们很好地执行了标准,所以我不太担心他们。

我正在使用 JQuery for JavaScript,这希望意味着我在 JavaScript 行为上没有太多差异,所以我主要关心的是 CSS。我想许多其他人也已经走上了这条道路,所以我希望有一个可用的样式表,当(有条件地)包含它时,它将修复在 IE 中查看仅用 Firefox 测试过的网站时出现的最常见的 CSS 问题。这样的事存在吗?

I have a website that I've developed and tested using Firefox 9 exclusively. I'm pretty happy with the layout/styles when viewed in this version of Firefox. I'm now facing the unenviable task of making it display equally well (or as close as possible) in IE7+ (I'm not supporting IE6). Naturally, I'd also like it to display well in Chrome & Safari, but I think they implement the standards reasonably well, so I'm not so worried about them.

I'm using JQuery for JavaScript, which hopefully means I don't have too many differences in JavaScript behaviour, so my chief concern is the CSS. I imagine many others have been down this path, so I'm hoping there's a stylesheet available which when (conditionally) included will fix most common CSS problems seen when viewing a website in IE that has only been tested with Firefox. Does such a thing exist?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

二智少女猫性小仙女 2025-01-03 10:22:13

一个包罗万象的 Miracle.css 文件可以解决所有与 IE 相关的问题吗?如果可以的话!解决方案可能归结为选择以下部分或全部内容:

  • 标准化 (http://necolas.github.com/normalize.css/)
    将大多数浏览器默认设置带到更一致的基线(将此视为流行的 Eric Meyer reset.css 的替代方案)
  • Modernizr (http://www.modernizr.com)
    鉴于您已经在使用 javascript,包括 Modernizr 将为您提供检测浏览器功能的其他方法。必要时还会自动将 .ie7 / .ie8 等类注入到您的标记中,允许您在样式中定位 IE,例如
    .standard { ... }
    .ie7 .standard, .ie8 .standard { ... }
  • CSS3PIE (http://www.css3pie.com/)
    渐进式 Internet Explorer - 允许在 IE 上通常失败的样式(例如线性渐变、圆角等)
  • IE7.JS (http://code.google.com/p/ie7-js/)
    可能是最接近你所追求的,作为 CSS 修复的替代方案(毫无疑问,这仍然是必要的)。不过应该可以帮助您更接近所需的最终结果。

A catch-all miracle.css file which cures all IE-related ills? If only! The solution will probably boil down to a selection of some or all of the following:

  • Normalize (http://necolas.github.com/normalize.css/)
    Brings most browser default settings to a more consistent baseline (think of this as an alternative to the popular Eric Meyer reset.css)
  • Modernizr (http://www.modernizr.com)
    Seeing as you're already using javascript, including modernizr will give you additional methods of detecting browser capabilities. Also auto-injects .ie7 / .ie8 etc classes into your markup where necessary, allowing you to target IE in your styling, e.g.
    .standard { ... }
    .ie7 .standard, .ie8 .standard { ... }
  • CSS3PIE (http://www.css3pie.com/)
    Progressive Internet Explorer - allows for styling which typically fails on IE (e.g. linear gradients, radiused corners, etc.)
  • IE7.JS (http://code.google.com/p/ie7-js/)
    Probably the closest to what you were after, as an alternative to CSS fixes (which no doubt will still be necessary). Should help get you closer to the desired end result though.
み青杉依旧 2025-01-03 10:22:13

我认为没有任何样式表可以为您完成此操作。

您可以查看一个解决 IE 问题的 js 脚本。或者,您始终可以使用 IETab 以老式方式进行操作,并针对您知道会出现问题的区域。

其中大部分描述如下:http://net.tutsplus.com/tutorials/html-css-techniques/9-most-common-ie-bugs-and-how-to-fix-them/
希望它有帮助:)

I don't think there is any sort of stylesheet that does this for you.

You may look into a js script that look at solving IE issues. Or You can always do it the old fashion way using IETab and targeting the areas where you know there is going to be issues.

Most of them are described here: http://net.tutsplus.com/tutorials/html-css-techniques/9-most-common-ie-bugs-and-how-to-fix-them/.
Hope it helps :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文