a "clear: smart" feature in CSS?

Hakon Lie (howcome@w3.org)
Mon, 8 Sep 1997 14:13:36 +0200 (MET DST)


Date: Mon, 8 Sep 1997 14:13:36 +0200 (MET DST)
Message-Id: <199709081213.OAA28041@stovner.a.sol.no>
To: "Rob" <wlkngowl@unix.asb.com>
Cc: www-html@w3.org
In-Reply-To: <199709060027.UAA08633@unix.asb.com>
From: Hakon Lie <howcome@w3.org>
Subject: a "clear: smart" feature in CSS?

Rob writes:

 > A common problem when laying out pages:
 >=20
 >  <img src=3D"relatively-large.gif" align=3Dleft>
 >  <p>This is a long paragraph describing stuff blah blah blah...
 >  (ok, it's not that long but pretent it is for the sake of argument)=

 >  </p>
 >=20
 > On browsers with even medium-sized windows, it looks fine. The image=
=20
 > is on the left and on the right is the text.
 >=20
 > But when the window is smaller (say using frames on a lower-
 > resolution screen) the paragraph is still on the right side of the
 > image, but only one word per line, which looks pretty ugly.

 > A better solution would be a "clear: smart-right" (or smart-left
 > etc.) attribute in CSS.  If there's plenty of room for text or
 > images on the right hand side, it won't clear. If there's not enough=

 > room (text cannot be rendered with more than two words per line: I=20=

 > can't think of a good general formula for this at the moment) that
 > it would clear. A browser or renderer that doesn't have the
 > 'smart's would clear for all instances rather than risk ugly
 > output.=20

In essence, this "smart" behavior is already built into CSS1 [1]:

  "The 'width' has a non-negative UA-defined minimum value (which may
   vary from element to element and even depend on other properties). I=
f
   'width' goes below this limit, either because it was set explicitly,=

   or because it was 'auto' and the rules below would make it too small=
,
   the value will be replaced with the minimum value instead."

[1] http://www.w3.org/TR/REC-CSS1#horizontal-formatting

I.e., UAs should be smart about this no matter what the value of the
'width' or 'clear' property is.

Regards,

-h&kon

H   =E5   k   o   n      W   i   u   m       L   i   e
howcome@w3.org      http://www.w3.org/people/howcome
World     W      i     d     e       Web  Consortium