Closed (fixed)
Project:
Conditional Stylesheets
Version:
6.x-1.1
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Jan 2010 at 02:09 UTC
Updated:
19 Apr 2011 at 08:41 UTC
Hello,
I have downloaded and enabled the Conditional Stylesheets module. I have a website where I am using a background (attached with a div class) in many of my blocks. They are displaying correctly in every browser except (of course) IE. I set up a new style for them in ie.css. However, when I view my site online, both styles are applying in IE. The style in the theme's.css says for the background to be a grey color. The style in the ie.css tells it to be green. On my page the green background appears underneath the grey background instead of replacing it. I am looking at it in IE8 and have not checked it in any other versions of IE. Am I missing something?
Comments
Comment #1
fastballweb commentedIf both backgrounds are being applied, it would seem that the module is working correctly. Its function is simply to put the stylesheet tag inside of conditional comments. So the fact that you're seeing both backgrounds at once in IE means that the module is doing its job and that your CSS isn't right for the effect you want. I would be happy to help if you provided a link so that I could see the CSS.
Comment #2
t14 commentedDont forget CSS is a cascading language so, it might be the case that your not using the same class names or IDs so the styles you want to use for IE are not replacing the ones you have defined in your other style sheet.
Hope that helps
Comment #3
alberto56 commentedI just add
to my IE rule.
See http://webdesign.about.com/od/css/f/blcssfaqimportn.htm
Comment #4
jaimealsilva commentedI'm having a similar problem. I have some rules in a css file that I try to override in the ie.css file that is put inside a conditional comment by this module, but it does not work. However, this is not directly a problem of this module but an IE problem since this module is working fine, it adds the conditional code correctly. The problem is that IE is not overriding the original css values from the first file with the ones in the latter file.
Furthermore, at the theme's .info file I have added the ie.css file to the end of of the stylesheets[all][] list so it gets included on all browsers and here is the funny thing: Firefox overrides the css values but IE 8 not!
So I guess that what heatherBoylan and I need is some advice in how to get IE to override the css values.
Here is some of the original css I'm using in the view-styles.css file of a Zen 2 sub-theme:
And this is the code in the ie.css file that is aimed to override some values:
As I said, on Firefox (after adding the ie.css file to the list of stylesheets) the values are change but on IE 8 it doesn't work.
Then I thought that maybe it is because those are dynamic items so I also changed the document background, just to test. So the code on ie.css now is:
But the problem remains, on Firefox the background now is green but on IE I keep seeing the original background.
What am I doing wrong? Should I make a blood sacrifice to the Redmond gods to make this work? or should I keep scaring away my windoze IE only clients by asking them to install Chrome, Firefox or Opera?
Comment #5
alberto56 commented@jaimesilva IE (all versions) ignores all css files after the 31st. Install http://drupal.org/project/unlimited_css and see if your problem persists. I just had the same problem last week and spent hours scratching my head, in addition to a partially sleepless night.
Comment #6
alberto56 commented@jaimesilva If the 31-file limit is indeed your problem, you might want to look at the issue #901974: On the project's home page, document IE's 31 stylesheet file limit
Comment #7
jaimealsilva commentedalberto56 you nailed it! thanks a lot!
Now I'm using IE Unlimited CSS on my development site and activating CSS performance optimization on the production site.
Btw, did you know my name is Jaime Alberto, we're "tocayos" :D
Comment #8
alberto56 commented@jaimesilva glad to hear it! I use IE Unlimited CSS on all my sites now to avoid this problem!
Comment #9
polishyourimage commentedThanks for the tips here - I spent maybe over 3 hours absolutely bewildered over why my IE7 conditional seemed not to be working. Enabling OPTIMIZE CSS FILES under /admin/settings/performance/default solved my problem.
IE is the evil.
Comment #10
dorapenaantury commentedpolishyourimage, thank you very much!
Comment #11
johnalbin#901974: On the project's home page, document IE's 31 stylesheet file limit is fixed.