Michiel
Michiel

Reputation: 8103

CSS problem in Drupal website in Internet Explorer 6

Ok, here is the deal. The following code is stated in my Drupal page.tpl.php and yet IE6 doesn't want to accept the display:none part.

<!--[if IE 6]>
    <style type="text/css">
        .coda-nav{display:none; position:absolute; width:400px;height:20px;top:260px;right:100px;z-index:125421;}
    </style>
<![endif]-->

Clearing the Drupal cache or the browser cache didn't help.
What is wrong with my code (it seems ok to me?)

And don't ask why I still write code for IE6, it's already humiliating enough :)

Upvotes: 0

Views: 192

Answers (1)

Marcel Korpel
Marcel Korpel

Reputation: 21763

All CSS rules are applied according to the cascading order, whether they live inside an IE-specific conditional comment or not.

In this case, adding !important to the value may solve your problem, unless other values that also are !important are specified with higher precedence.


BTW, if you only want to address IE 6 and 7, you can also add an other word than important after !, like

display: none !hotdog;

In those broswers, this will have the same effect as adding !important.

Upvotes: 1

Related Questions