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:

Attributes inherited from Element

class

The style class of the xbl:binding. Multiple classes may be specified by separating them with spaces.

display

Although the display property is part of standard CSS, some additional values are allowed, for the XUL layout styles. You can use these values for non-XUL elements too, although they may produce unusual results.

- -moz-box: Child elements are laid out horizontally or vertically.
- -moz-inline-box:
- -moz-grid: Child elements are laid out as a XUL grid.
- -moz-inline-grid:
- -moz-grid-group: Child elements are laid out as a group of grid columns or rows. This is the layout used by the rows and columns elements. You can use the orientation (-moz-box-orient) to set which direction. Rows would normally have vertical orientation and columns would have a horizontal orientation.
- -moz-grid-line: Child elements are laid out as a single column or row of a grid. You can use the orientation (-moz-box-orient) to set which direction.
- -moz-stack: Child elements are laid out one on top of each other like the XUL stack element.
- -moz-inline-stack:
- -moz-deck: Child elements are laid out one on top of each other like the XUL deck element. Unlike a stack, only the top element is displayed.
- -moz-popup:
- -moz-groupbox:

extends

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

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

Copyright (C) 1999 - 2002 XULPlanet.com