views:

43

answers:

1

I have the following

<div id="border" style="width:100%; border:8px solid #FFF">
    <div id="menu" style="width:250px; float:left;" >
        Some menu
    </div>
    <div id="content" style="padding-left:270px; width:520px;" >
        Main page content
    </div>
</div>

This gives me a left aligned menu and the content to the right of it, all surrounded by a border.

On all browsers including IE8 it displays correctly.

But on IE7 the content only starts below the menu, and leaves a big open space to the right of the menu.

I have searched all kind of solutions and tried all kinds of combinations of right, left, none for float. clearing left right both. It always displays different on the browsers.

Any help is appreciated. Michael

+2  A: 

Remove the padding on your content div and set it to float left.

You might have to put <div style="clear: left"></div> after it

SLC
I had tried that. It did not work, because the border div then had a height of 0, thereby removing the border. Adding the div clear: left worked. Thank you so much.
Michael Frey
No problem, don't forget to accept answers if they solve your problem by clicking the little tick :)
SLC
Just realized that the problem was fixed in IE7, but now i have a new problem in Chrome. The content now displays to the right of the menu, and when the menu ends, the content continues under the menu. In IE7 the content continues in a straight line, without aligning to the left.
Michael Frey
Ignore that comment. My mistake. It does work. And I ticked your answer.
Michael Frey