W3C home > Mailing lists > Public > www-style@w3.org > August 2002

Re: Float overflowing behavior

From: Jan Roland Eriksson <jrexon@newsguy.com>
Date: Thu, 15 Aug 2002 10:44:09 +0200
To: www-style@w3.org
Cc: Bill Daly <billdalynj@yahoo.com>
Message-ID: <atomlu4nvb6vfjcp0j9qr4qgsd8nac6psf@4ax.com>

On Wed, 14 Aug 2002 07:37:11 -0700 (PDT), you wrote:

>--- Jan Roland Eriksson <jrexon@newsguy.com> wrote:
>> And yet the real solution is so fantastically
>> simple?
>>   <http://css.nu/exp/layer-ex3b.html>
>>   <http://css.nu/exp/layer-ex3b.html>
>>   <http://css.nu/exp/layer-ex3d.html>

>I don't see that as a solution, so much as a hack.

In my examples (which I have deliberately kept simple and down to
point) it's a "hack" yes. Never the less it was originally suggested
directly to me by none the less than Haakon Vium Lie at the time when
I was doing these "studies" ;-)

>The empty div which you add in those examples has no
>relevance to the structure of the document, and does
>not belong.

I would take it for granted that a clever markup and CSS author would
find a way to exploit my deliberately empty DIV element for something
good instead, i.e. put some content in it and style it differently if
need be. I put it there to illustrate the effect of 'clear: both;'
that's all.

>It is being used purely for presentational purposes.

I have used it as an illustration as to what is needed already in CSS1
to make a containing element fully enclose a floating element.
That's the purpose of my experiments, nothing more, nothing less.

>While I have seen this in use, and have used it myself in some cases,
>I don't see it as the proper way for this effect to be accomplished.

Proper or not; given a web totally polluted with 'text/html' tag soup,
I can't see this "hack" as really violating anything at all in fact.

My markup is syntactically correct, as opposed to the vast majority of
idiocy one can find on the web.

>...What is needed is some CSS property which can
>be applied to a floated element which will allow its
>container element to take the size of the floated
>element into account and adjust its size accordingly.

IMHO I think you are looking at that from the "wrong end" of it.

I agree; it would be nice to suggest via CSS that containers are
supposed to fully enclose their contained elements, even if a
contained element has been suggested to 'float' (and thus has been
taken out of the 'flow').

IMO though; it seems to be more logical if such a property is applied
to the containing element instead of the contained element.

That's the way my "hack" works, it expands the container as far as
required but no more than that, and leaves the floating element
intact. Move that functionality over from markup to CSS and we are
home free.

-- 
Rex
Received on Thursday, 15 August 2002 04:45:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:15 GMT