Closed Bug 228240 Opened 21 years ago Closed 21 years ago

float attribute of IMG tag causes containing DIV to be of wrong vertical size

Categories

(Core :: Layout, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: bugzilla, Unassigned)

References

()

Details

(Whiteboard: dupeme)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031211 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031211 When DIV contains IMG and some text, and IMG's float attribute is set to either "right" or "left" with css, DIV is sized vertically to fit text, but not image. Not setting float attribute, causes DIV to be sized to fit intire image inside it. What's real scary, is text following DIV with float image is also affected by the float. Reproducible: Always Steps to Reproduce: 1. visit test case URL supplied Actual Results: DIV box is sized less then image, causing DIV's border to go under image. Expected Results: DIV box should be sized to enclose entire image.
This is INVALID per CSS specification, you need to use the 'clear' in some places. I won't mark it as INVALID, since this is probably a duplice of something. Does anyone know which one?
Whiteboard: dupeme
->invalid I only care about duplicates for things there's a chance we might make quirks for.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
I will remember that. v
Status: RESOLVED → VERIFIED
The bug was not about how one float affects another. It is about DIV's box not streaching enough to enclose the image it contains. Take a look at even more simlified example. http://e-world.unisa.edu.au/~eugene/mozbugs/image_float/test2.html or am I totaly missing something? Anne van Kesteren, I looked at CSS specs and I am not clear how my example is invalid per CSS spec. I'm no pro tho. Pointer to css spec that say it's invalid would be much appreciated.
Sorry, I meant that the behavior is correct per CSS specification <http://www.w3.org/TR/CSS21/visuren.html#floats>: > Since a float is not in the flow, non-positioned block boxes created before and > after the float box flow vertically as if the float didn't exist.
You need to log in before you can comment on or make changes to this bug.