[thelist] Css and IE? PATCHED

Mark Groen evolt at markgroen.com
Tue Feb 6 00:02:58 CST 2007


On Monday 05 February 2007 21:47, Jeremy Weiss wrote:
> I just wanted to thank Mark and Hassan for their help.
>
> I've gone back and revalidated the page as XTHML Strict and I've also
> validated the CSS. The problem came down to a difference in how IE and
> Firefox calculates margins and such (a single line of code, no less). I
> couldn't seem to figure a way around this, so I just split the css into two
> files and threw together a quick php script to check the user agent and
> serve up the right file. Not the most elegant (hence the subject of PATCHED
> and not SOLVED or FIXED), but it'll have to do for now.

For that sort of thing happening in IE6, Microsoft recommends (as do I) using 
a "conditional comment" to serve up the alternate styles need for that 
particular element. Uses fewer server resources, forward compatible, etc. 
etc.

Example for a style sheet and javascript file for less than IE version 7, 
placed in the head section after your other style sheet links so it falls 
last in the cascade:

<!--[if lt IE 7]>
<link href="/css/ie6.css" rel="stylesheet" type="text/css" />
<script src="/js/ie6flikr.js" type="text/javascript"></script>
<![endif]-->

More info:
http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp
-- 
cheers,

        mark



More information about the thelist mailing list