views:

323

answers:

3

Hi, i have a class let's call it cell,

.cms-block .cell{ width:520px; float:left;}
.cms-block.wide .cell{width: auto; float:none}

in IE 6, the child elements of .cms-block.wide .cell loose their borders/background colors. if I take away the float:none; the borders are there. but... the cell is floating left. argh. I looked around and i found a lot of pages describing peek-a-boo bugs. but to this specific problem i could not find an answer so far.

peace

m

+2  A: 

give it layout?

.cms-block.wide .cell { zoom:1; }

meder
+1. Theoretically, this shouldn't solve the problem, but HasLayout is the source of a great deal of black magic in the IE6 engine, and I have a hunch this may help.
Daniel Pryden
There's nothing logical about Trident :p
meder
This doesn't work when you want to do a display:inline...
Paul
A: 

IE6 is extremelly buggy, and non-standards compliant. It is almost 3 years since IE7 came out. So there really shouldn't be any IE6 installations left, but unfortunately there are.

But the approach that I would take if I were you is to get acceeptance not to support IE6. I'm working on a greenfield web project, and we have deliberately decided to not support IE6.

Pete
Hey, I passionately hate IE6 like any other self respected web developer. However living in China, XP is the top OS, people are not as savvy and concerned about "standards" etc. The fact remains, IE 6 is default browser, people don't upgrade (most sites look better in IE because they are made for IE) and see no reason too. And the client doesn't want to go on a campaign explaining his customers to upgrade/change.So that's the short story of why I gotta support IE6
Moak
You have my sympathy then ;)
Pete
+1  A: 

Your problem is probably related to the fact that you're selecting multiple classes with your .cms-block.wide selector, but IE6 doesn't support that. A quick Google turns up this page, which may be helpful to you.

Daniel Pryden
It must support multiple classes otherwise the width of the cell would still be 520px; no?
Moak
It supports multiple classes, just not multiple-class selectors. So IE6 interprets your `.cms-block` rules, but considers your `.cms-block.wide` rules as if they were declared with just `.wide` for the selector. See the link I gave, it adds more information.
Daniel Pryden
I see what you mean, thanks for the tip, in the end, the zoom thing is what worked, the triggering of hasLayout, black magic indeed.
Moak