https://developer.mozilla.org/en-US/docs/CSS/Understanding_z-index
ここを読むと分かる。
「できない」って書いてあるのは、ここらへん。
https://developer.mozilla.org/en-US/docs/CSS/Understanding_z-index/The_stacking_context
Within a stacking context, child elements are stacked according to the same rules previously explained. Importantly, the z-index values of its child stacking contexts only have meaning in this parent. Stacking contexts are treated atomically as a single unit in the parent stacking context.
本家よりは、MDN の方が分かりやすいと思うので、そちらを紹介しました。
本家では、ここらへんになるのかな...
http://www.w3.org/TR/CSS21/visuren.html#z-index
Within each stacking context, positioned elements with stack level 0 (in layer 6), non-positioned floats (layer 4), inline blocks (layer 5), and inline tables (layer 5), are painted as if those elements themselves generated new stacking contexts, except that their positioned descendants and any would-be child stacking contexts take part in the current stacking context.
▽2
●
oil999 ●100ポイント ベストアンサー |
親要素にz-indexを設定している場合、その中の要素でz-indexを指定しても親要素内でしか効果がありません。