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

RE: shrink-wrap

From: Joe Hewitt <joe@joehewitt.com>
Date: Thu, 6 Apr 2000 16:10:07 -0400
To: <www-style@w3.org>
Message-ID: <000101bfa004$1af413a0$31cfb326@zenimax.com>
You're missing the point here.  The tool-tip example was not meant to
express a need for tool-tips specifically, it was to express a need for
absolutely positioned elements whose dimensions are dependent on the size of
their intrinsic content.

I realize that few people today use absolute positioning, but this does not
mean that it is not meaningful and very important.  As demonstrated by my
tool-tip example, the current box model is skimpy in regards to absolute
positioning.  It does not provide quite enough flexibility.

Fixing this problem may be just as simple as specifying that the following
combination: "position: absolute; display: inline; width: auto; height:
auto", will result in a box which, though absolutely positioned, determines
it's size the same way that a static/relative inline box would.  Currently,
the display: inline is ignored, and the box is treated as block-level.

Take for example, this HTML element:

<div id="mommmy" style="position: relative; width: 200px; height: 300px;">
	<div id="subject" style="position: absolute; display: inline; width: auto;
height: auto">This is a test of the emergency broadcast system.</div>
</div>

In this case, the dimensions of #subject will be as wide as the text can go
without exceeding the bounds of it's containing block.  If the text happens
to be smaller (in width or height) than it's containing block, the div will
then take on the exact size of the text.  If it is wider than it's
containing block, it will wrap, unless "white-space: nowrap" is specified,
in which case it will be as wide as necessary.  If it does wrap, then it's
height will be only as tall as is necessary to contain the wrapped text.

Note that this behavior will only be applied if "display: inline".  If
"display: block" then it will behave exactly the way it does now.  This is
an easy solution to implement because it requires no additional CSS
properties, and only specifies a change in behavior when display: inline and
position: absolute are combined.  Since there currently is no specified
behavior for this combination (it is told to ignore the inline and make it
block), this should be backwards-compatible for 99.9% of web pages.

- Joe
Received on Thursday, 6 April 2000 16:05:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:04 GMT