开发者

A guide to hacking IE8 into shape?

I've finished making my website, but then I loaded it up in IE8. Big problems! For instance, a bunch of my div and span开发者_JAVA百科 elements seem to be transparent (they should have coloured backgrounds), and floating elements don't work.

When I was developing my site, I had hoped I would just be able to ignore the older internet explorers - ie9 is standards compliant, and eventually everyone will end up using that. However, Microsoft are not releasing IE9 for XP, but people are going to be using that operating system for a long time still, I think. As such, I need to support IE8.

Does there exist a comprehensive list of all the things that IE8/ do wrong? Not something like Quirksmode.org, but a guide to the common issues with layout in IE8, and the hacks needed to fix them?

EDIT: The transparent elements thing seems to be somehow related to my use of css3pie.


You could try using conditional classes to target specific fixes for specific versions of IE. This is from Paul Irish's HTML5 Boilerplate:

<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->

With these comments you can specify something like:

.ie7 #container {margin-left:-1px;}

And it would only change your #container margin on IE7.

If those don't work, post some of your code and people might be able to point out some incompatibilities.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜