Closed Bug 227018 Opened 22 years ago Closed 22 years ago

elements aligned via html are treated as floated alignments and do not expand div containers

Categories

(Core :: DOM: CSS Object Model, defect)

x86
Windows 2000
defect
Not set
minor

Tracking

()

VERIFIED INVALID

People

(Reporter: keith, Unassigned)

Details

Attachments

(3 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 A div should expand for each new element even if the element is aligned to the right. Reproducible: Always Steps to Reproduce: 1. Create div 2.Creat some text 3.insert a <Br> 4. Insert a right aligned image Actual Results: the image floats outside the div, if you add another br and more text that is not aligned the box will expand to encapsolate it, but not when the second line is only the aligned images Expected Results: The div box should have expanded around the image
Attached file Example of bug
A quick view of the bug, display in ie to see how it should look.
An example of what i was attempting and the problems this bug causes
1. If you create a test case, please do it correct 2. If you want to do that, you first have to make sure there is an image (not sure if alt will do) 3. You add the image as attachment. 4. You link to that attachment from your HTML file. 5. You add the HTML file as attachment.
Summary: elements aligned via html are treated as floated alignments and do not expand div contianers → elements aligned via html are treated as floated alignments and do not expand div containers
Mozilla's layout is correct. This is explained with illustrations at: http://www.w3.org/TR/CSS21/visuren.html#floats The exact rules for height are at http://www.w3.org/TR/CSS21/visudet.html#q19 "Only children in the normal flow are taken into account (i.e., floating boxes and absolutely positioned boxes are ignored, and relatively positioned boxes are considered without their offset)." Try adding <div style="clear:both"></div> after the floats to get what you want. --> INVALID
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
Attached image Image for ANNA
Some people have requested that the images referenced in the example html be posted, even though the image height and width was purposely set in the html to allow the layout of the bug to materialze while making the purpose of the image utterly irrelevant to the problem being described. However since these people took time out of their precious day to make their voice heard on this contenious topic i have caved and posted AN image to be used in the example html. For those of you with out an image.
There most be somethign else going on as well then, i ahve a javascript function that increase and decrease the height of a div element with in these two divs provided. When this situation is in play and you run the javacript to open and close the div box after the 5-7th time the second image snappes to where i would have expected it and stays there. Once i get to work i'll post the additional code that shows this. ITs what lead me to believe it was a bug, because of the inconsitant nature in this instance. But thats probably something else, i'll try the clear:both and see how that works.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → INVALID
-> VERIFIED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: