[Project_owners] Wrapping XUL elements

Neil neil at parkwaycc.co.uk
Fri Jun 22 11:30:01 PDT 2007


eric.jung at yahoo.com wrote:

>> Both the <label> and <description> elements support wrapping text. 
>> Simply set the text as the .textContent rather than as the .label, or 
>> in the XUL as <description>This text will wrap</description>. Note 
>> that they prefer not to wrap, so you typically need a max-width style 
>> to force the issue.
>
> I didn't know about that. Neil, should I update 
> http://developer.mozilla.org/en/docs/Code_snippets:Label_and_description 
> with this info?

Actually it does mention that the text should be in a text node rather 
than the value attribute (and not label as I wrote, oops). It could be a 
bit clearer though:

    * With the default white-space: wrap; all whitespace runs (including
      newlines) are treated as single spaces. Text is permitted to wrap.
    * With white-space: pre; all whitespace, including newlines, is
      rendered literally; text cannot wrap automatically.
    * With white-space: -moz-pre-wrap; (there is no -moz-pre; style) all
      whitespace is rendered literally, but text is additionally
      permitted to wrap at spaces.

In any case, the text can also be made to wrap by inserting an 
<html:br/> element.


More information about the Project_owners mailing list