Why z-index does not work for transformed element?
Sent by Philippe Wittenbergh on 8 January 2012 05:05
On Jan 8, 2012, at 1:47 PM, Peng Yu wrote:
> In the following example, no matter what z-index I set, div2 is always
> above the first div. Does anybody know how to change css to make div2
> in the bottom? Why z-index does not work with transform?
In general, z-index only applies to positioned elements as already noted.
However, transformed() elements establish their own stacking context, and z-index _should_ apply
even if the element is not positioned.
> Any value other than ‘none’ for the transform results in the creation of both a stacking context
and a containing block. The object acts as a containing block for fixed positioned descendants.
The text does not yet mention z-index… it was agreed within the CSS WG, however.
BTW - a positive z-index will move your element higher in the stacking order, if you want it below
(under), try a negative z-index.
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/