开发者

Recommended css / js stack for making IE render properly

There are so many stylesheets & javascript libraries out there that make a designer's life e开发者_开发知识库asier by forcing the Internet Explorer to behave a little more reasonable - but I'm overwhelmed by the range of possibilities (html5shiv, DD_belatedPNG, ie7-js, css3pie etc.).

What stack are you using and why?


The only one I use is the PNG transparency fix that you mentioned (DD_belatedPNG). When it comes to IE6 and 7, if you're aware of the common bugs and their solutions (such as the IE6 box model bug), I've found that you can easily work through the issues by using specific stylesheets for each browser.

Check out conditional comments, which provide a way to target only certain versions of IE for given markup, so you can do thins like conditionally include different style rules. For example, if you need to support IE6, make a CSS file just for IE6, and include it like this:

<!--[if LTE IE 6]>
    <link href="/path/to/ie6.css" rel="stylesheet" type="text/css" />
<![endif]-->

Also, the use of valitators are extremely helpful, so check out the markup validator and the CSS validator. There are many cases where Firefox and other browsers are lenient about poor markup, but IE will fail in spectacular fashion. Validators are a great way to save a lot of trouble.

And finally, always include a doctype as the first element in your markup, otherwise quirks mode will be triggered in IE, which is essentially the IE 5.5 rendering engine (which you usually don't want if you're trying to support standards complaint browsers).

Edit: Just to try to answer your original question, the reason why I don't really use any of the mentioned solutions is because IE6 and 7 are the only problem children. I've never had to use an IE8 specific stylesheet, so the pain is only scoped to those two browsers. jQuery will handle cross browser specifics when it comes to Javascript, so that is a huge help also.


The most important things you can do to make IE 6 + 7 play nice is by using a CSS reset, and making sure your HTML validates.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜