I'm working on a site right now that's working just fine in every browser I've tried except IE. Behavior varies depending on version but I'm concentrating on 7 and 8. The weird thing is that on two different computers both using IE8, the layout appears differently. One renders the page correctly while the other has some positioning problems that show up when I view the page on IE7.

I can get the page's appearance to be more or less consistent between IE7 and IE8 by taking out the doctype but my client wants the site to be standards compliant. How do I work around this? Thanks.

  • I would definitely avoid removing the doctype! Use one that triggers standards-compliant mode in both browsers and work from there. Tiffany S about 7 years ago

2 answers

This was chosen as the best answer

I would force IE into standards-complaint mode by specifying the correct doctype and validating your code (see doctype triggers here) (validate here) and then use conditional statements to adjust for problem browsers (see conditional statements). Also, you can use this meta tag to force IE 8 to behave like IE7 if that would help you (see meta tag here). Additionally, here is a list of common IE CSS bugs you may be experiencing that may help you solve your problems.

Hope that helps!

Answered about 7 years ago by Tiffany S
  • huh. I didn't know about those conditional statements. doesn't seem to work in the style tag but I can use it. jsalita about 7 years ago
  • You place the conditional statements outside of the style tags. You use the conditional statements in the header, and put either another set of style tags and styles inside them, or a link to a separate stylesheet. Like so (if this code shows): <!--[if IE ]> <link href="iecss.css" rel="stylesheet" type="text/css"> <![endif]--> Tiffany S about 7 years ago
Marcel 57

You could also force IE8 to act like IE7 by putting this into your :

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
Answered about 7 years ago by Marcel
  • I mentioned that above already. ;) Tiffany S about 7 years ago