An element that renders its children on top of each other. The first element is placed on the bottom and each successive child is placed above the previous. All elements are displayed at once. Child elements may also be placed at absolute positions within the stack.
The top
, right
, bottom
, and left
attributes on a child of the stack
specify the position of that element.
The bottom
and right
attributes can also be used in conjunction with top
and left
to set the width and/or height of the children of the stack
.
Note that bottom
and right
attributes, unlike rect, are relative to the bottom and right of the stack.
When using these attributes to set width or height, both attributes for the given axis must be explicitly set, eg, if setting width, both "left" and "right" must be set.
In some case, setting the width or height this way may even be necessary because using the width/height attributes (eg, "width", "minwidth" and "maxwidth") inside a stack can sometimes produce unpredictable and undesireable results.
More information is available in the XUL tutorial.
<stack> <hbox flex="1"> <image src="chrome://xulschoolhello/skin/stack-bg.png" flex="1"left="10"right="10" top="10" bottom="10"/> </hbox> <hbox> <!-- Some content here. --> </hbox> </stack>
In this example, the resulting width of the top-most hbox will be 400px (600px - 200px - 0
) :
<stack width="600">
<hbox flex="1">
<!-- content -->
</hbox>
<hbox left="0" right="200"
>
<!-- Some content here. -->
</hbox>
</stack>
AttributesInherited from XUL element |
Inherited Properties |