|
Posted by dorayme on 01/13/07 01:40
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 the reason it's particularly counterintuitive in your example is
> that the big white div has a left-margin, so the nav col float is
> already out of the way of the text. But the browser doesn't think like
> that, it just applies the rules, and clear means "go down past the
> floats". As far as it's concerned, the margin has nothing to do with it.
Indeed. And thanks for your explanations. It is not that often I
use floats in this situation or, to put it slightly differently,
when I do, they have usually cleared the nav col naturally by
being introduced "after" the nav col data has finished. Luck of
the game as to when I would come across it.
As it happens, for experiment only, this is not a site launched
with any of my work in it yet, I tried
<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;
}
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)? 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?
This clearing div is doubtless not semantically kosher. But that
is strictly another issue. Doubtless, I am missing something. But
it is an interesting matter.
--
dorayme
Navigation:
[Reply to this message]
|