|
Posted by Ben C on 01/13/07 09:46
On 2007-01-13, dorayme <doraymeRidThis@optusnet.com.au> wrote:
> In article <slrneqg5dj.a9t.spamspam@bowser.marioworld>,
> Ben C <spamspam@spam.eggs> wrote:
>
>> On 2007-01-08, dorayme <doraymeRidThis@optusnet.com.au> wrote:
>> [snip]
>> > In case anyone is interested, I was supposing that when you have
>> > a box and float stuff in it, subsequent clears in that box would
>> > apply only to the floats in that box.
>>
>> No, clear clears any floats that are in the way (or perceived to be in
>> the way).
>>
>
> Yes, I came to realise, disappointedly, that this might be the
> case. I would think that in future css, the suggestion implied in
> my para above - considering that floats are often used these days
> for columnar purposes - might be worth considering.
I think better would be for inline-block to work everywhere (the
situation is already improving), use that for columns instead.
[snip]
><http://www.netweaver.com.au/khs/>
>
> where I have a
>
><div class="clear"></div> after the sentence employing the
> floated drop cap. And the <h2> below, now behaving itself as I
> want and no longer clearing the nav col float (reminder,
> previously I had cleared this <h2> andt cause my surprise).
>
>
> .clear {
>
> margin: 0;
> margin-top: 40px;
> }
You could alternatively put the margin-top on the h2 ("Who we are").
> This has not resulted in any clearing of _all_ the floats, just
> the one I wanted cleared. The effect seeming to be what I want.
> How come this div, empty as it is, "starts" before the navigation
> pane float ends (height-wise, if you follow me)?
There's no "clear" set on it at all, just a top margin. So it starts
below the preceding block box (p id="welcome") in the normal way.
> As against the direction in which your explanation was meaning (I have
> left out quoting it here). Obviously because it is empty, but is this
> not slightly counter-intuitive again after one has trained one's
> intuition to accept the clearing of all floats as correct?
I think you must have deleted "clear: left" from .clear and forgot you'd
done it.
There is a way to get clear to restrict itself only to the white box,
which is to make the white box itself a float.
The clear and float properties only take into account floats in the same
"block formatting context", but note that a "block formatting context"
is not just any block box.
Block formatting contexts are rather obscure, but as far as I can see,
the basic purpose of them is restrict the effect of floats. Floats mess
up things in their own BFC but not outside.
Navigation:
[Reply to this message]
|