Sent by Zoe M. Gillenwater on 29 November 2004 16:04
ceo wrote:
> Zoe M. Gillenwater wrote:
>
>> No, it is correct for their left margins or padding to flow under the
>
>
> As per the context of the original post, I meant "wrong" as in "this
> violates the principle of least surprise".
Just because in this particular situation it makes the most sense to
*you* for floats to *not* drape over the box does not mean this is
always the case. See this article for the reasoning behind floats'
behavior of only displacing inline content:
http://www.complexspiral.com/publications/containing-floats/
>> This is correct behavior. The most common way to work around it it
>> to assign the non-floated container a left margin equal to the size
>> of the float so that it moves out from under the float. But
>> apparently you do
>
>
> Um, why bother using layout, and CSS? Lets just use fixed-size tables!
> (tongue in cheek).
>
> Seriously, though, does this work? What happens when (random visitor
> to website) alters the font size in their browser?
The text gets bigger. That's it. If you make the font size super big
and you have really long, unbreakable words in your float, for instance,
the text will start to overflow, but funky things are going to happen
with super large text sizes no matter what layout method you use.
> If I understand correctly, I either have to hardcode the float width,
> and cause the text to either overflow or wrap badly, OR I leave the
> float to autosize, and then the hardcoded "left margin" for the main
> content will be "wrong".
If you don't set a width for your float, no, you cannot assign a
matching left margin for your main content. But there's no reason to
not add a width to the sidebar on your particular page.
>
>> not want to do this because you want the main content to wrap below
>> to the float once it has ended, correct?
>
>
> Indeed, this is an extra problem it throws up. And if you accept this,
> then in comparison to the above then it appears it is easier and more
> effective to just use an HTML TABLE: it does the same job but without
> having to hack-up the layout with dodgy hard-coded widths?
No, there is no way to do this with a table. I think we are
misunderstanding each other: do you or do you not want your main content
to wrap *below* the float once it has ended? If you do want this to
happen, you cannot use a table and you should not add a left margin to
your main content. If you do not want this to happen (ie, you want a
two column look all the way down the page) then just add a left margin
to your main content.
> Is there no *other* solution to this? Do we just have to wait for CSS
> 3? :)
Again, I need to understand what exactly you are trying to do. A
graphic mockup would be helpful. I think you are misunderstanding how
floats work, and I'm probably not understanding your goals.
Zoe
--
Zoe M. Gillenwater
Design Specialist
Highway Safety Research Center
http://www.hsrc.unc.edu
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/