So far we have discussed two methods of fixing IE's rendering issues with web pages; we're about to add one more. Each method is broadly associated with the severity of issues that IE has in displaying a site:
- Low to mild problems in IE
- Typified by: a few elements displayed out of place when the page is rendered in IE, with perhaps several CSS effects not being supported; a best-case scenario that is usually gained by crafting valid code and occasional testing in IE during development.
Solution: IE CSS hacks added directly to the existing stylesheet.
- Moderate severity
- Typified by: multiple elements displayed incorrectly in IE; usually due to extensive use of CSS.
Solution: Conditional comments to introduce a limited set of IE-only CSS fixes (see below).
- High severity
- Typified by: the page being unreadable or unusable in IE, usually due to high use of CSS or HTML5.
- Solution: clean up your code and use a JavaScript shim to fix the problems IE has with your page.
Note that the appropriate solution depends upon the degree of the problem; just as a doctor should not over-prescribe antibiotics, it is a waste of resources to load in a 60K of JavaScript to fix problems that could be solved by adding just a few lines of CSS.
- Solution: clean up your code and use a JavaScript shim to fix the problems IE has with your page.