solves my problem

  old&nojob 08:48 24 Sep 2006
Locked

I have a situation where there is a div containing several divs which contain various elements p, img, etc in a properly ordered way. The parent div has a 1px margin and a 1px border and 5px of padding - pretty normal. IF I have a right float (e.g. an image to the right of a text para) as the last element before the closing div /div> of the inner div then IE6 breaks and the left border and margin gets corrupted. OK in FF, N8 and Op8. I have found that if I put a para after the rougue float (and it's the floa that's causing it) the problem is solved. So as I do'nt want a para I've put a p>  /p> there instead.

Is this a classic IE problem and how do I properly deal with it?

  old&nojob 08:49 24 Sep 2006

Sorry I put " " at the front of my title and it does not appear. Due to the "&" I suppose.

  Eric10 11:12 24 Sep 2006

In cases like this I usually use <br clear="right">. This makes sure that any following code starts below the image. If "right" isn't appropriate then you can use "left" or "both" instead.

  old&nojob 11:22 24 Sep 2006

Yes, thanks that works as well in all tested browsers. Neither of these seems semantically correct and I assume it will work in IE7!

Perhaps being sematic about it is a bit picky - any thoughts?

  ade.h 16:55 24 Sep 2006

I like being semantically correct, in both senses of the term!

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

OnePlus 5 review

Alice Saey's mesmerising animation for Dutch singer Mark Lotterman

iPad Pro 10.5in (2017) review

Comment booster votre iPhone ?