Forum Moderators: not2easy
It works fine in I.E, which seems weird, as normally any problems I have are the opposite.
I cant post any code as i'm not on the comp with the code and the site is not live yet. I know it sounds pretty vague as i cant point to specific code, but im just wondering if anyone instinctively knew what the problem could be?
Any help would be greatly appreciated!
<div id="container">
<div id="thisIsFloated">...</div>
<div id="thisIsFloatedToo">...</div>
</div>
Floating an element takes it out of the normal flow, so in the example above "container" is essentially empty, so no background will be shown. IE6 will incorrectly make "container" still contain the floated children, which is why the background shows up in IE.
To fix this, add something that clears the floats after them. For example:
<div id="container">
<div id="thisIsFloated">...</div>
<div id="thisIsFloatedToo">...</div>
<br class="endOfSection">
</div>
Then your styles would include:
.endOfSection { clear: both; }
Since the br is not floated, "container" still contains it. And since the br is set to clear both, it must appear below any floats. Therefore, it will appear as though "container" still contains the floated elements.
Another solution may be to float "container" as well. But this generally makes it harder to center.
Hope that helps.