CSS Styles missing from my site when view in Internet Explorer (IE)

Events happening in the community are now at Drupal community events on www.drupal.org.
jggarley's picture

I'm having some problems with my site when view in Internet Explorer. My website (http://www.cincyliberians.com/) has no css styles apply when view in IE browser but works fine in Firefox, Netscape,etc. What I don't understand is why some of the pages have css styles in IE but some do not, especially the front/home page. I'm using the picture reloaded theme and when I switch to the default theme (Garland) or any other theme, it still does not have css styles. Please help me!!. I installed the Unlimited_CSS module and thought it would help solve the problem but it does not. What should I do to get my site appear in IE the way it does in Firefox?

Comments

O-M-G! Thank you. I'm having

tubby's picture

O-M-G! Thank you. I'm having the same issue. I thought I'd screwed up my CSS but I posted about the exact same problem a week or so ago.

I looked at your source and we appear to be using some of the same modules. I was going to try disabling some of them to see if that was the cause.

One question though, are you using the theme's style.css or local.css file?

I'm using the theme's

jggarley's picture

I'm using the theme's style.css file. This driving me nut as almost all my users (if not all) use Internet Explorer.

ok. i think you're supposed

tubby's picture

ok. i think you're supposed to use one or the other, not both. i'm not sure if that's what's causing the trouble OR...i'm wondering if the panels module might be the culprit. we both seem to be using it and i dont recall having trouble until after it was enabled.

will work on it and let you know what i come up with.

This is likely caused by the

dunkoh's picture

This is likely caused by the jquery cycle plugin or something similar.
jggarley - maybe if you try disabling the ddblock module and see if your issue goes away.

Firebug in Firefox gave this in console: "[cycle] terminating; zero elements found by selector" and googling for that I came to the page in this link: http://old.nabble.com/Invalid-Argument-in-IE7-8-td22499089s27240.html

You have 34 stylesheets

jacine's picture

You have 34 stylesheets loading at the link you provided. CSS aggregation should be enabled for live Drupal sites. If you don't know how, visit: admin/settings/performance and scroll down. This will eliminate the need for any module that manipulates your CSS files, as all of your stylesheets will be combined into one.

Yep, that'd be the reason

himerus's picture

Jacine is right here. Go to your admin/settings/performance page, and enable CSS aggregation. That should solve the problem if that is the cause. I've seen it quite frequently, and it only happens when tons of modules also include tiny CSS files here and there.

Give it a shot, that should probably solve it. Afterwards, you may need to clear cache, and it should all work

Thank you

csgp85's picture

Thank you. This solved a major problem for me that I could not figure out.

I changed enabled "Optimize CSS files" within "Bandwidth optimizations" on the admin/settings/performance page and it worked on IE.

Fixed it for me too.

Edward Clement Lee's picture

Thanks!

thanks...

gurpreet2000's picture

thanks... it works :)

Than you so much

Muhammad Nasir's picture

Jacine thank you so much you have solved my problem now my site css fine apply on IE browser. once again thank you so much........!!!

That was my first though but

jggarley's picture

That was my first though but it does not help too. I disabled the ddblock module as of now and still it's not working. I think I started getting this after I enabled the ddblock module but disabling it does not solve the problem.

ditto. and css caching for

tubby's picture

ditto. and css caching for me no longer works. when it's enabled, none of the css files are loading. i also had the ddblock module enabled. i disabled it and still getting error.

You also have the

dunkoh's picture

You also have the jquery_plugin module which you should try disabling to see if that helps - it's loading the jquery.cycle.min.js

Be sure to clear cache before testing.

Having problem with css aggregation/compression

stg11's picture

I was able to get my 34 css files to work for IE without aggregation using the unlimited css module. However, for performance I would really like to use the aggregation feature. I tried disabling hovertips, jquery update and jquery ui (cleared cache of course) and it's still not working. I'm wondering: Is there a 30-file limit in the actual aggregation/compression function or if it's probably something else? I am also using ctools/panels which perhaps is the culprit but if I turn those off the site is pretty well decimated.

PROBLEM SOLVED!! Enabling the

jggarley's picture

PROBLEM SOLVED!! Enabling the css aggregation solved my nightmare. A BIG THANKS to you all for your prompt and fast response.

Below are my settings for the Performance tab

Page cache
Enabling the page cache will offer a significant performance boost. Drupal can store and send compressed cached pages requested by anonymous users. By caching a web page, Drupal does not have to construct the page each time it is viewed.

Caching mode: set to Normal

I got this message in RED: "The following enabled modules are incompatible with aggressive mode caching and will not function properly: backup_migrate"

Minimum cache lifetime: Not set? Any recommendation?

Page compression: Enabled

Block cache: Disabled (grayed out)

Optimize CSS files: Enabled

Optimize JavaScript files: Disabled

FIXED!

chadhester's picture

Great find... Lower in this group Todd Nienkerk mentioned that IE only supports up to 30 stylesheets. That's certainly going to cause issues with several pages overall.

It appears that enabling "Optimize CSS files" consolidates the CSS into one large file (for better or worse). This resolved my issue. I had about 33 CSS LINK tags in the HEAD of my theme from various modules.

I love Drupal because I LOVE the community and their great support. :)

SOLVED! I still can't get

tubby's picture

SOLVED! I still can't get optimize css files to work but, i installed Unlimited_CSS module.

i renabled the ddblock and jquery. for now, everything seems to work fine.

thanks

EDIT
i also want to add that i had to break-up the original css file. i divided style.css into four separate css files. i then added these css files to the themes .info file. i deleted all the contents in the orginal style.css. i found that if i kept all the data in the style.css file, the styling would break in IE, Safari and Netscape. but by breaking it up into separate files and using the unlimited_css module, everything seems to work just fine.

IE limits the number of stylesheets

todd nienkerk's picture

Perhaps this is already obvious to everyone, but this is a known IE limitation:

http://drupal.org/node/228818
http://support.microsoft.com/kb/262161

IE only supports 30 instances of the <style> tag. Anything after that is ignored. This results in various stylesheets being ignored.

Todd Ross Nienkerk
Digital Strategist and Partner
Four Kitchens: Big ideas for the web
IRC: toddross

Hello if css aggregation

dreadfulcode's picture

Hello

if css aggregation doesn't work-- which I strongly recommend leaving off until you are in production mode--

you can install IE Unlimited CSS Loader It is a very lightweight module that can uninstall once you go into production mode, when you can simplay enable X aggregation. Install, and viola! infinite css pages will load in ie6, 7, and 8.

I recommend leaving performance enhancements such as js and css aggregation turned off because you never know what other problems may arise as you install new modules or make changes to your theme during production mode.

Develop first, optimize last.

not working in IE

vivionacom's picture

Hi Dudesolutions,

I tried to download IE Unlimited CSS Loader and the other two mentioned in the module. it says not compatible with drupal 7. you run into that error before?

and when i tried to use the aggregate the CSS function, the page went blank.

not sure what to do here.

any suggestions?

thanks

Similar issue...

nyleve101's picture

The first page of my website has no css style in Internet Explorer but all subsequent pages do. I’v e checked on other browsers and my site works fine in Mozilla and Safari. When i use the ‘Optimize CSS files’ option under performance the whole of my site loses its css style in every browser. This appears to be the case regardless of what theme i use. Does anyone have any idea?

Any help is greatly appreciated.

Evelyn

IE Unlimited CSS Loader

yes it works....there is this

-----

Drupal Development by Trio Interactive

Unlimited CSS - Thank you!

scottsawyer's picture

Gosh, IE broke a Web site, big surprise!

You guys (and gals) rock!

Thank you, thank you.

Works

mahen1984's picture

Thank you so much. got a solution with css aggregation :)

Site not loading in IE

dumidesign's picture

Hi

Earlier Site was working fine with FF but after install IE CSS Optimizer then Now both FF and IE not working Please help me this is the site url

http://demoplease.org/pearl/

if i disable the Optimize CSS file in performance then FF is working fine. but not in IE
Help me please

thanks

Dumidesign
www.dumidesign.com

I checked in FF and all looks

sgprs's picture

I checked in FF and all looks well. In IE, overall looks good except for the footer that is center lined (in FF it on the left). But it looks ok to me. What should it look like?

I use Garland and I have the

udane's picture

I use Garland and I have the same problem. Did you finf a solution?
Thanks

Issue Resolved

sohail.alee's picture

I also had the same problem and now it has resolved with the help of you guys.. Thanks alot :)

I had been avoiding this

focal55's picture

I had been avoiding this problem in IE for a month now. Did a quick google search and found this thread. Much thanks to the community on this one.

Is CSS aggregation completely

Stomper's picture

Is CSS aggregation completely reversible, ie. I can disable it and it will not mess up my original stylesheets?

Yes, you can disable it at

theresaanna's picture

Yes, you can disable it at any time. It doesn't actually edit the stylesheets you write, but rather reads them and compiles a new file to use instead of each individual stylesheet.

Thanks for the reply. I am

Stomper's picture

Thanks for the reply. I am having a secondary issue. When I enable CSS optimization in Firefox (The browser where my site renders correctly) it completely messes up the styling. I don't even leave the option enabled long enough to check if it corrected styling on IE. What would cause this?

Usually invalid CSS code will

sheena_d's picture

Usually invalid CSS code will create problems during CSS compression. If you are missing a closing bracket or something in your CSS file, it will sometimes work fine in most browsers until you take out all the whitespace (returns and spaces, which is what CSS compression does).

I would suggest running any CSS code your wrote through the W3C CSS validator.

valid code w3c

Stomper's picture

Thanks for the suggestion, sheena. I think you're right because I have run my site through W3C and it did not validate, either my HTML or CSS, or both. Are they separate validators?

Yes, they are different validators

cliff's picture

Stomper, I'm not sure what you mean to say you did, but there is a markup validator and a CSS validator.

The markup validator checks your markup language against the specification indicated in your document's document type declaration (DTD). To the best of my knowledge, this validator cannot tell you whether HTML5 or WAI-ARIA is valid. In other words, it might tell you that a page written in HTML5 or containing WAI-ARIA is invalid when it's actually valid. Why? Because it takes time for specifications to become stable, and once they do it takes time to write validators to check against them.

The CSS validator checks your CSS — either as a separate file or from CSS embedded into another file — and tells you whether it is valid. In advanced settings, you may select the profile, medium, and type of warning you want to probe.

Golly! Thanks, Everybody!

DrupalDarling's picture

Golly! Thanks, Everybody!

This solution worked for me as well:

Go to admin/settings/performance
Optimize CSS files: Enabled
Click "Save"

Thanks!

Many thanks

BLOK Man's picture

Thank you for posting this.

I used IE Unlimited CSS Loader

Clearing things up.

voj's picture

The modules you installed is not the problem in IE.

The real problem is IE, because it has a rule limit about css.
A sheet may contain up to 4095 rules
A sheet may @import up to 31 sheets
@import nesting supports up to 4 levels deep

It seems some themes uses alot of CSS, and when you install some module that also uses CSS(via drupal_add_css()) this might increase the number, thus some CSS stylesheet will not be loaded.

To solve this, the loaded css must be cut down. Drupal uses aggregation of CSS which will solve your problem goto admin/settings/performance and choose optimize CSS.

not working in IE

vivionacom's picture

I used the aggregate the CSS function, the page still does not look right. No images at all. :-(

not sure what to do here.

any suggestions?

thanks

Does it work in FF or Chrome?

scottsawyer's picture

If you check the image locations in IE Dev Tools, do you see the image locations? Are the images there?

Also, clear Drupal cache and your browser's cache.

Post a link and I'll take a look ( though, I don't have IE :)

FF and Chrome

vivionacom's picture

actually it doens't work in FF and Chrome either. they all look the same. No images. www.grouposh.com. thanks for looking into it.

I get this

ian-moran's picture

I get this message:

Forbidden
You don't have permission to access /index.php on this server.

Looks like you need to change your folder permissions.

Hi folks, I've ran into a

RAWDESK's picture

Hi folks,
I've ran into a similar problem as initially described by the author of this article.
Only difference is that the IE CSS symptom in my setup only occurs when the initial client's html source was not build via IE.
I'll explain it further :
A few days ago, i successfully installed and configured Drupal Boost on a highly CSS, JS, Jquery driven theme based website : http://tczelem.be
Other installed performance related modules :
https://www.drupal.org/project/advagg
https://www.drupal.org/project/lazyloader
The setup with Boost takes care of caching pages in predefined html folders, resulting a quicker respond on repeated views.
When these html files are generated by an IE client, repeated views are ok on all browsers.
If not, repeated views on IE lack the necessary CSS execution.
So next logical step was comparing both IE and FF cached html files but i cannot find an indication leading to this IE behaviour.
Comparison is visible here : http://www.diffnow.com/?report=vcnz0

Any suggestion to solve this would be welcome.
Thanks,

When these html files are

RAWDESK's picture

When these html files are generated by an IE client, repeated views are ok on all browsers.

Small yet important addition/correction to my previous post :
When these html files are generated by an IE client, repeated views hitting the IE reload button are ok when still on that freshly cached page.
If reload happens from the menu or other entry point, the symptom reoccurs in IE.