Internet Explorer 6 and 7: floated elements expand to 100% width when they contain a child element floated right. Is there a workaround?

后端 未结 8 945
滥情空心
滥情空心 2020-12-13 06:43

I\'ve got a parent div floated left, with two child divs that I need to float right.

The parent div should (if I understand th

8条回答
  •  眼角桃花
    2020-12-13 07:25

    A very hacky but a CSS only solution that works okay in IE, chrome and FF.

    I took kaba's solution - but the problem was, it works okay in IE but all the other browsers show a 4px space between the 2 child divs. The space remains as 4px even if the content on both the divs expand. So to fix that I've used IE conditional statements. I doesn't look like the best code in the world but it gets the job done.

    
    
    
    
    
    Float test
    
    
    
    
    Tester2
    Tester1

提交回复
热议问题