I would like to make my website compatible with all types of internet explorer, as at the moment it is only compatible with IE6, and glitches a lot in newer versions. How can I do this? I understand it has something to do with the code below that I found in a file named "ie6.css". Tha code is below.

/* IE6 specific styles */
.extra-wrap, .news li {zoom:1;}
有帮助吗?

解决方案

Firstly, make sure you have a valid <!DOCTYPE>. That's the number 1 reason for browser glitches between different browsers/versions.

If you don't have a doctype declaration at the top of your page, the browser will go into Quirks mode, which will cause you problems.

Give it a valid doctype (best go with <!DOCTYPE html>). That might cause other issues in the short term, but once you've fixed those it will be much better at working properly cross-browser.

Secondly, does it work in other browsers (Firefox, Chrome, etc)? Modern IE versions are generally standards compliant, so if it works in other browsers it should work in IE10/11. If it works in other browsers and not IE11, then you probably have some IE-specific hacks that were needed for older IE version but don't need to be there for newer versions. Get rid of those.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top