Re: Float overflowing behavior!

On Monday 2002-08-19 17:01 +0400, Vadim Plessky wrote:
> On Friday 16 August 2002 10:00 pm, Boris Zbarsky wrote:
> |  > Using 'width:auto' when you need div taking all width, is stupid, STUPID
> |  > approach!
> |
> |  Would you care to clarify this point of view?  Why is this stupid?
> 
> If someone familiar with ,mathematics (or in particular, with geometry) - he 
> thinks of something as XX percent of another thing (xx/100 fraction) or A/B 
> fraction.
> And you can understand width: 100% *without* redaing W3C CSS specs.
> What "auto" means is really unclear. Both for mathemation and for ordinar 
> user.
>  Oh, yes I realize that people on www-style list should be aware of W3C CSS 
> specs. 
> But I doubt typical web master will take his (her) time to read *all* W3C 
> specs...  On th eother hand, he (she) will understand what width: 100% means.

If CSS worked the other way around, we'd doubtless have complaints from
irate web authors on www-style like:

  I specified a width for these images, and it always worked correctly,
  scaling them exactly by a factor of two.  But then I decided to put a
  border around the images, and for some stupid reason all the browsers
  decided to shrink the images.  CSS is stupid.  When I specify a width
  I mean the width of the content, not the width of the content and the
  padding and the border.

In other words, there are tradeoffs to be made, and there are arguments
on both sides of whether 'width' should include the padding and border.
I think the strongest argument is that CSS, like many other systems for
document layout, works largely by parent elements constraining children
elements rather than the other way around, and therefore it's simple to
to get both effects (although specifying an outer width requires adding
extra markup) with the model used in CSS while the opposite model would
make it very hard to specify a content width.

-David

-- 
L. David Baron        <URL: http://www.people.fas.harvard.edu/~dbaron/ >

Received on Monday, 19 August 2002 13:56:01 UTC