Re: CSS equivalent to WRAP?

On Thu, 28 Jan 1999, Eric A. Meyer wrote:

> A discussion recently cropped up on the WSP Standards list to the
> effect of "how come neither HTML or CSS have the WRAP attribute, or
> its equivalent, for TEXTAREA elements?" I postulated that
> 'white-space' might be that equivalent, but not too many people
> bought it-- including me, once I really thought about it.
> 'white-space: normal' would cause the collapse of whitespace in the
> user input,
Hmm.

I suggest a fourth value for white-space: nocollapse. Then, the pre vale
would be like having both nowrap and nocollapse at the same time.

Thus:

--------------------------------------------------------8<------------
     
   'white-space'

          Value:       normal | pre | nowrap [INS:] | nocollapse [:INS] |
                       inherit
          Initial:     normal
          Applies to:  all elements
          Inherited:   yes
          Percentages: N/A
          Media:       visual

   This property declares how whitespace inside the element is
   handled. Values have the following meanings:

   normal 
          This value directs user agents to collapse sequences of
          whitespace, and break lines as necessary to fill line boxes.
          Additional line breaks may be created by occurrences of "\A"
          in generated content (e.g., for the BR element in HTML).

   pre              
          This value prevents user agents from collapsing sequences of
          whitespace. Lines are only broken at newlines in the source,
          or at occurrences of "\A" in generated content.
     
   nowrap
          This value collapses whitespace as for 'normal', but
          suppresses line breaks within text except for those created
          by "\A" in generated content (e.g., for the BR element in
          HTML).

[INS:]     
   nocollapse
          This value prevents user agents from collapsing sequences of
          whitespace, as for 'pre', but lines may be broken as necessary
          to fill line boxes. Additional line breaks may be
          created by occurrences of "\A" in generated content (e.g.,
          for the BR element in HTML).
[:INS]

--------------------------------------------------------8<------------

> plus 'white-space' applies to block-level elements, which TEXTAREA
> is not (right?).
It is a replaced element.

However, it has already been suggested that white-space be allowed on
all elements in CSS3. The above suggestion takes that as a given.

-- 
Ian Hickson

Received on Friday, 29 January 1999 08:40:42 UTC