Hi,
Once I was happy with my new deezign[1], I noticed how bad it breaks in IE
(all versions I tried). Since IE7[2] didn't give acceptable results, I
wrote a simplified style that I would fetch to IE. How to do it is the
point of my post.
I am using for now conditional comment[3] (clean) to give IE its CSS, and a IE
parsing bug[4] (not clean) to hide the real CSS from IE:
<!--[if IE]>
<link rel="stylesheet " type="text/css" href="site-IE.css">
<script src="navbar.js" type="text/javascript"></script>
<![endif]-->
<style type="text/css"><!-- @import url(site.css) all; --></style>
I am wondering whether a better method exists, especially one that would:
* not rely on a IE bug to hide the CSS file
* not break HTML validation (no <![if !IE]>...<![endif]>)
* provide good browsers with the two alternative stylesheets
* deal with several CSSes: all pages include (by SSI) site.css (or
site-IE.css), but some also include pro.css (resp. pro-IE.css), some
others perso.css (or perso-IE.css) (if I read the specs correctly,
<link rel="alternate stylesheet" ...> cannot fulfill this requirement)
A method that solves just one of the four points above would already be
great!
[1] http://yo.dan.free.fr/
[2] http://dean.edwards.name/IE7/
[3] http://msdn.microsoft.com/workshop/a...omment_ovw.asp
[4] http://www.phoenity.com/newtedge/hide_css_ie/
PS: I take this post as an opportunity to thank those who ansered my newbie
questions a while ago, and to thank everyone who intervenes in this forum:
you are definitely helping more than one person when you answer one
question! (I have been lurking for quite a while, as obviously many others
do.)
--
Daniel Déchelotte
http://yo.dan.free.fr/