W3C home > Mailing lists > Public > www-style@w3.org > February 2000

Re: box-sizing alternative

From: Tantek Çelik <tantek@cs.stanford.edu>
Date: Tue, 29 Feb 2000 12:00:02 -0800
Message-Id: <200002292000.PAA13850@tux.w3.org>
To: Joe Hewitt <joe@joehewitt.com>, www-style@w3c.org
>From: "Joe Hewitt" <joe@joehewitt.com>
>Date: Tue, Feb 29, 2000, 11:45 AM
>> Yes, simplicity (and ease of authoring) is a core goal of CSS.
> It appears that I am losing this argument, but the point of it is to do just
> as you have said above : go for simplicity and ease of authoring.

It is always good to establish common goals in a discussion.  They provide a
point from which agreements can be built.

I am glad we are agreed on this point (simplicity and ease of authoring),
because I have often found that there are those that strongly prefer
theoretical architectural purity over practical simplicity and ease of

> Can you please try and justify why it is "easier to author" via
> "content-box" than "border-box" ?

It is easier to author when you know you have a consistent sizing model across
all elements.

If you want all your elements to behave as border-box (which, I will agree
with you, in many ways, is easier to author to than content-box), you can
simply put this in your author style sheet:

* {box-sizing:border-box}

And then you're done, use width and height to your heart's content to
determine the total size of an element including borders and padding.

The point is that this solution (using box-sizing once) is simpler than
redefining width and height in general, and introducing two more properties.
Perhaps subtly simpler, but simpler none the less.

> I believe it is dramatically easier to
> use "border-box".

I won't disagree with that.  I have found applications where that is true as

> I will even dare to say that the fact that IE4/IE5/NN4
> have implemented "border-box" by default helps to prove my point.

Not quite.  It is not consistent.  IMG for example is box-sizing: content-box.
There are other elements which are box-sizing:content-box by default as well.

> Millions
> of developers are used to using it this way.  Why change it?

I very much agree that it is good to try and support the way current
developers work.  CSS-1 width and height were a change from that (with good
reason - it is a simpler, easier to learn and implement model), and box-sizing
help bridge this gap.

Received on Tuesday, 29 February 2000 15:02:56 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:53 UTC