Mozilla XUL Element and Script Reference

Contents  Quick Reference

Text

A piece of text. It can be used as a label for another element by using the for attribute. The text does not wrap so text only appears on one line. If the text does not fit, it will be cropped according to the crop attribute.

Example:

    <text value="Look at me! I'm a label!"/>

Attributes:

Attributes inherited from XUL Element

crop

If the label of the text is too small to fit in its given space, the text will be cropped on the side specified by the crop attribute. An ellipsis will be placed in place of the cropped text.

flex

Indicates the flexibility of the text. Flexible elements grow and shrink to fit their given space. The actual value is not relevant unless there are other flexible elements within the same container. Elements with larger flex values will grow more than elements with lower flex values, at the ratio determined by the two elements.

for

The attribute is used when the text element is used as a label and is similar to the for attribute on an HTML label. It should be set to the id of an element that the label is associated with. When the user clicks on the label, the associated element is given the focus.

height

The height of the text in pixels. It is recommended that the CSS height property be used instead.

label

The label that will appear on the text. If this is left out, no text appears.

left

For elements placed within a bulletinboard, specifies the position of the left edge of the text.

maxheight

The maximum height of the text. This corresponds to the max-height CSS property.

maxwidth

The maximum width of the text. This corresponds to the max-width CSS property.

minheight

The minimum height of the text. This corresponds to the min-height CSS property.

minwidth

The minimum width of the text. This corresponds to the min-width CSS property.

orient

Used to specify whether the children of the text element are oriented horizontally or vertically. You can also use the '-moz-xul-box-orient' style property.

top

For elements placed within a bulletinboard, specifies the position of the top edge of the text.

width

The width of the text in pixels. It is recommended that the CSS width property be used instead.

JavaScript Properties and Methods:

Properties and Methods inherited from XUL Element