views:

46

answers:

1

I have a situation where IE7 is simply not applying styles, even though it claims it is.

I have an element on my page. In the CSS, I have defined a rule that should apply "display: none" to it, so it should not be displayed.

It's still displaying.

I downloaded the IE Developer Toolbar, and found the element in the DOM selector. I right-clicked and selected "Applied Styles." Right there, IE claims that it is applying my "display: none" rule. In fact, the "Applied Styles" dialog confirms everything I think I know about my CSS and how it should be applied.

Yet the element remains.

Now, I'm not asking anyone to debug my CSS here. I'm asking, if the IE Developer Toolbar claims/confirms this element should be gone, but it's still there...what does that mean, exactly? Since the Toolbar is on my side, I think my CSS is fine.

Is there some IE7 bug I'm not considering?

Edit:
One thing that might be relevant: the LINK elements that load the stylesheets are applied to the page in Javascript, via "document.write". I'm starting to suspect that has something to do with it.

Update:
No, that has nothing to do with it. I took the LINK tags out of the script and inlined them. The problem remains.

A: 

yes I'd check it in other browsers, but it's not un-common for IE (Any version) to be the odd man out. The other thing that springs to mind is whether there is some other CSS that is overriding your CSS. Are you seeing all the CSS that is being applied to the element and which of the CSS styles is the final one being applied?

Derek Clarkson
I have confirmed it's the last applied, and, as I mentioned, IE seems to agree with that fact since the Developer Toolbar is claiming that this is the CSS that it has, in fact, applied.
Deane