views:

79

answers:

3

Just made a site using great standards compliant semantic HTML and CSS. It looks great in Gecko, Web Kit, but IE7 mangles it (of course). Any progress yet on this front, or do I have to go through a tonne of hacks as is standard with IE.

+1  A: 

There are several well-known hacks for hiding IE-specific demangling rules from comformant browsers. Most of them depend on IE mis-parsing certain things, e.g. "* html ... { }" which other browsers will ignore. A simple google search will show any number of these.

My rule is first to make the page work in FF (or similar), and then break it so it works in IE.

Peter Rowell
A: 

I find that developing a site first for IE, then adapting it to other browsers is less time consuming than the other way around. But, it's a little late for that!

I would suggest that you have a separate CSS file for IE (just copy and paste and rename current CSS) then have a browser sniffer and script that requests the IE CSS for IE users. Then rewrite just the IE CSS. Does that make sense? At least that way, the site is still up for the other browsers and you're just working on IE.

Laura
Don't use sniffing - it's unreliable. Use conditional comments instead; that's the best way of ensuring that (specific versions of) IE sees certain styles without applying them for everyone else. http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx
Michael Madsen
+4  A: 

Try this

<!--[if lt IE 8]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta3)/IE8.js"&gt;&lt;/script&gt;
<![endif]-->

Or you could write a separate css file for IE7

<!--[if IE 7]>
<link rel="stylesheet" href="css/ie7.css" type="text/css" />
<![endif]-->
Shuriken