This chapter defines the CSS 2.1 painting order in more detail than
described in the rest of the specification.
The bottom of the stack is the furthest from the user, the top of the
stack is the nearest to the user:
| | | |
| | | | ⇦ ☻
| | | user
z-index: canvas -1 0 1 2
The stacking context background and most negative positioned
stacking contexts are at the bottom of the stack, while the most
positive positioned stacking contexts are at the top of the stack.
The canvas is transparent if contained within another, and given a
UA-defined color if it is not. It is infinite in extent and contains
the root element. Initially, the viewport is anchored with its top
left corner at the canvas origin.
The stacking order for an element generating a stacking context (see
the 'z-index' property) is:
The background of the root element is only painted once, over the
While the backgrounds of bidirectional inlines are painted in tree
order, they are positioned in visual order. Since the positioning of
inline backgrounds is unspecified in CSS 2.1, the exact result of these
two requirements is UA-defined. CSS3 may define this in more detail.