How To Create an IE-Only Stylesheet
The tool of choice for fighting IE problems is the conditional stylesheet. IE provides comment tags, supported all the way up to the current IE 8 to target specific versions, as well as greater-than/less-than stuff for targeting multiple versions at once.
Why use conditional stylesheets?
- You got problems, they need fixin’
- Keeps your code hack-free and valid
- Keeps your main stylesheet clean
- Perfectly acceptable technique, sanctioned by Microsoft
1. Create a stylesheet and javascript common for all browser, without using any hacks to work around rendering problems in MSIE
2. Create a stylesheet and javascripts common for all versions of MSIE.
3. Create a separate stylesheet and javascripts for each of the MSIE versions you want to target.
4. Include the stylesheets and javascripts from 2 and 3 by using conditional comments.
One good example can be found at http://www.gpuri.com
Comments
Leave a Reply
