Home > Element Reference : Binding

Contents

### Binding

Declares a binding. The id attribute is used to identify a binding and refer to it within a style sheet via the -moz-binding property. The same binding can be used to attach to any number of elements.

For example the following style property will refer to a binding with an id of dropbox:

      -moz-binding: url ('chrome://myapp/skin/mybindings.xml#dropbox');

A binding element may contain an content tag, an implementation tag, an handlers tag and an resources tag.

More information about binding

Attributes:

display | extends | id | inheritstyle

#### Attributes:

##### display

Type: string

This attribute specifies how the tag is displayed. By setting this attribute, you can have an element have the layout and display characteristics of an existing element. For example, use the value 'xul:button' to create an element that is displayed like a button. The part before the colon is a namespace prefix so you must declare the XUL namespace as well. Not all tags have a unique display type. The following XUL display types may be used: browser, button, checkbox, description, editor, grippy, iframe, image, label, menu, menuitem, menubar, progressmeter, radio, resizer, scrollbar, scrollbox, spacer, splitter, titlebar, treechildren and treecol. You may also use a number of HTML, MathML and SVG tags.

##### extends

Type: binding URL

Bindings may inherit content, properties, methods and event handlers from other bindings. The binding will have the content and implementation of the parent binding as well as any defined by itself. The extends attribute should be set to the URI of the binding that it is inheriting from.

##### id

Type: string

A unique identifier so that you can identify the binding with.

##### inheritstyle

Type: boolean

If this attribute is set to true, the content in the binding will inherit style rules from the document the element the binding is bound to. This means that the stylesheets for the XUL document will affect the content inside the binding. If this attribute is false, document stylesheets do not affect the appearance of the binding content. The default value of this attribute is true.

Copyright (C) 1999 - 2004 XulPlanet.com