Specifying CSS stack order without using z-index
I am wondering if either of the following are possible:
- Is there a way to use z-index without specifying the position attribute for an element.
- Is there any way to specify the CSS stack order for elements witho开发者_JAVA百科ut using either the z-index property or the position attribute
According to w3school
z-index
can only work on positioned elements.The only other way is change the order of the elements in the html.
(1) No. see the CSS specs:
For a positioned box, the 'z-index' property specifies:
1. The stack level ...Each positioned box in a given stacking context has an integer stack level.
(2) No. the CSS stack order is the z-index
精彩评论