If this is off-topic Eric, just slap me down, but I think it's interesting
and a recurring css problem indicating something wrong with the spec. In any
case, I'll leave the suggestion at this unless someone has a further point.
>>>The container I put the float in *contains* the float:
>This is not much of an argument for this being the way floated elements
Actually, it's not an argument at all ;-) It's how I'm suggesting it should
work based on what people need to do with floats, and avoid garbage code.
>>The IMG escapes its P container, blasts through the border,
>> Who in his right mind ever wants that?
>Someone laying out a bio with an inset image of the person wrapped by
paragraphs of text, someone laying out an article with pull quotes that are
set into the body of the article, someone styling a page with a large, inset
initial cap contained within a short initial paragraph, etc.
None of those need to pop out of the container. Just place the float outside
the containers of text. The float container should still contain the float.
You don't want your New Products pull quote to pop out of its section and
poke over the border into the Blog section, do you?
>>>Any suggestions on how best to force the container to stretch???
>Sure, don't use a float .. just increase the left padding of the paragraph
and position the image to
sit in the space the padding leaves
That doesn't work because the page can be any size and you never know how
things will line up, and shouldn't have to.
>if you desperately want to float the image would be to
clear the second paragraph and set a min-height on the first paragraph
that forced it to be no smaller than the height of the floated image.
That doesn't work either for the same reasons. In my experience, the only
solution to the w3c spec problem is garbage code thrown in at the end (div
with a clear). -Which clearly indicates it *is* a problem.
>>It really shouldn't work that way. The reason the floated image doesn't
"stretch out" the container is because once it is floated *it is no
longer in the normal flow of the document*. How could it be?
Very easily: because it is far better for putting pages together, browers
are told to stretch containers to contain their floats that would otherwise
pop out of them. Do you ever want a float to pop out of the container (that
couldn't be written another way)? -Hence all the hacks. That's why I am
asking if there is an example of why the present spec is better, or
something I'm missing which requires the w3c behaviour. I was hoping someone
who helped design the spec was on this list and could explain.
Thanks Jeremy. I remember reading this long ago; I'll look again.