Making IE Specific CSS or Code (Conditional Comments)
You can also find an inline CSS hack for Internet Explorer 6 and 7.
While recently giving Titoonics Sporkle gamesite a makeover, I made an Internet Explorer 5.0 and 5.5 specific CSS stylesheet.
While it is a pain to develop for archaic browsers, Internet Explorer on Windows platforms support a fairly straight-forward and simple method, that’s not even a hack.
As a webdesigner, it is quite a challenge to design and build a site that is supposed to attract many viewers on many platforms. I can’t just choose to design for the latest and greatest. Decisions on what one wants support, must be made, and the design should ideally “degrade gracefully” on unsupported browsers.
CSS For Older Than Internet Explorer 6
In my case, I needed a stylesheet specifically for Windows browsers older than Internet Explorer 6.
Thus, this piece of code came to the rescue:
<!--[if lt IE 6]> <style> @import url("/oldbrowser.css"); </style> <![endif]-->
In human tongue, it says “if browser is less than IE 6, use this stylesheet”.
CSS For All Versions Of Internet Explorer (Windows)
If you just want to attach a stylesheet, or display a chunk of code to all versions of Internet Explorer, you can use this code:
<!--[if IE]> <style> @import url("/ie.css"); </style> <![endif]-->
CSS Not Shown To Internet Explorer 6
This is useful, for instance, if you want to serve a stylesheet free version of your site to IE6 users.
<![if !(IE 6)]> <style> @import url("/not_ie.css"); </style> <![endif]>
There are many more of these “out commenting”, or tricks for you to refine your stylesheets. For a complete list, I have to redirect you to this document on conditional comments.
- Visual Thesaurus
- Making IE Specific CSS or Code (Conditional Comments)
- Using Named Anchors in Flash
- Fahrenheit 9/11
I am trying to use this code.. On a mac IE 5.5.
And I cant let this work ...
Any suggestions ?
Quote
i was just trying it too on mac, and its running same version, cant get it to work either.
Quote
Well, this will only work on Windows versions of Internet Explorer. Are you really designing for IE 5.5 Mac?
Quote
hehe, just looked at when u posted this , well four years later .. you got any solution ? :D
Quote
Sigge: Yes, the old IE 5 Mac backslash hack:
/* import stylesheets and hide from ie/mac \*/
@import url("screen.css");
/* end import and hide */
Read more here:
http://www.simplebits.com/notebook/2009/02/13/iegone.html
Quote