This element is used to create a block of text. The text can be set either with the value
attribute or by placing text inside the open and close description tags. The value
attribute is used to set text that appears in a single line. If text appears as a child of the description, it will wrap to multiple lines. It may contain arbitrary markup, which can be styled as needed.
More information is available in the XUL tutorial.
- Properties
- accessibleType , crop , disabled , tabIndex , value
- Style classes
- header , indent , monospace , plain , small-margin
Examples
This is a long section of text that will word wrap when displayed
<description> This is a long section of text that will word wrap when displayed. </description>
This is a long section of text that will not word wrap
<description value="This is a long section of text that will not word wrap"> </description>
This is a long section of dynamically controlled text that will word wrap
<description id="desc" style="width: 300px"></description>
document.getElementById('desc').textContent = "This is a long section of dynamic message text that will word wrap";
Attributes
Inherited from XUL element
align
, allowevents
, allownegativeassertions
, class
, coalesceduplicatearcs
, collapsed
, container
, containment
, context
,
, datasources
, dir
, empty
, equalsize
, flags
, flex
, height
,
, id
, insertafter
, insertbefore
, left
, maxheight
, maxwidth
,
, minheight
, minwidth
, mousethrough
, noinitialfocus
, observes
, ordinal
, orient
, pack
, persist
, popup
, position
, preference-editable
, querytype
, ref
, removeelement
, sortDirection
, sortResource
, sortResource2
, statustext
, style
, template
, tooltip
, tooltiptext
, top
, uri
, wait-cursor
, width
crop
crop attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.startendleftrightcenternonenone and the displayed text is larger than this maximum width, you may be able to use the max-width CSS property (or the maxwidth attribute) to override this size. For example, for a menuitem in a menu you can add the following CSS rule when you want to use the value none:
menupopup > menuitem, menupopup > menu { max-width: none; }
disabled
true the element is disabled. Disabled elements are usually drawn with grayed-out text. If the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
disabled
property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.tabindex
tab" key. Elements with a higher tabindex are later in the tab sequence.
value
Properties
Inherited Properties
align
,
attributes, allowEvents
,
baseURI, boxObject
, builder
,
childElementCount,
childNodes,
children, className
,
clientHeight,
clientLeft,
clientTop,
clientWidth, collapsed
, contextMenu
, controllers
, database
, datasources
, dir
,
firstChild,
firstElementChild, flex
, height
, hidden
, id
,
lastChild,
lastElementChild, left
,
localName, maxHeight
, maxWidth
, menu
, minHeight
, minWidth
,
namespaceURI,
nextElementSibling,
nextSibling,
nodeName,
nodeType,
nodeValue, observes
, ordinal
, orient
,
ownerDocument, pack
,
parentNode, persist
,
prefix,
previousElementSibling,
previousSibling, ref
, resource
,
scrollHeight,
scrollLeft,
scrollTop,
scrollWidth, statusText
, style
,
tagName,
textContent, tooltip
, tooltipText
, top
, width
accessibleType
Methods
Style classes
-
header - A class used for headings. Typically, this will cause the text to appear bold.
-
indent - This class causes the text to be indented on its left side.
-
monospace - This class causes the text to be displayed in a monospace font.
-
plain - This class causes the element to be displayed with no border or margin.
-
small-margin - This class causes the text to be displayed with a smaller margin.
Mozilla Developer Network