3
votes

I am nearing the end of a Drupal 7 website build and am testing in browsers. Everything is fine in all browsers except for IE 7&8 - this appears to be a common problem.

I've read a lot about how IE 7&8 ignore more than 31 stylesheet requests.

I've actioned a lot of the suggestions I've found on Stackoverflow and the Internet.

  • Compress the CSS files in Performance -> Aggregate and compress CSS files - I now can see 5 stylesheets loading in the source however, IE still doesn't load my stylesheet!
  • I have added a direct call to my IE7 stylesheet, before all other stylesheets in my html.tpl.php file (hardcoded)
  • I've also used a module called Conditional Stylesheets to allow calling specific stylesheets in the .info file

None of these have worked.

I've also added the following to my template.php file to remove certain Drupal CSS files as suggested by James Hopkins (I know it says IE6 but hey, worth a go.

# get array of stylesheets
$css = drupal_add_css();
unset($css['all']['module']['modules/system/system.css']);
unset($css['all']['module']['modules/system/defaults.css']);
unset($css['print']['theme']['themes/mytheme/print.css']);

LINK TO WEBSITE 88.208.247.36 It's still in ip format as domain has not been passed over to the webserver yet.

1
Can you be more specific as to which files aren't being requested? 31 is excessive. - cimmanon
Well there is a "main.css" file which controls all of my styles for the design. Chrome, FF, IE9, Safari etc all pull the styles fine. IE 7&8 seem to stop loading the styles towards the bottom of this stylesheet. I think Drupal calling so many css files is insane, but I'm a little new to it, so I've kinda taken it as gospel (also found a lot of references to it on the net!) - Nick Douglas
31 or more is very typical of a modern Drupal site, and that's on reason we use aggregation. - Chris Miller

1 Answers

-1
votes

Have you tried this?

Add this to your clinigen.info file:

stylesheets-conditional[lte IE 7][all][] = _css/ie7.css

And remove this from main.css:

@import url("ie7.css");