a "clear: smart" feature in CSS?

Rob writes:

 > A common problem when laying out pages:
 > 
 >  <img src="relatively-large.gif" align=left>
 >  <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>
 > 
 > On browsers with even medium-sized windows, it looks fine. The image 
 > is on the left and on the right is the text.
 > 
 > 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 
 > 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. 

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). If
   '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   å   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

Received on Monday, 8 September 1997 08:13:45 UTC