Skip to content
wangb edited this page Jun 5, 2018 · 2 revisions
  1. work for non-static positioned element.
  2. some situations overlap can happen
  • negative margin
  • position: absolute
  1. positioned elements always appear above static elements.
  2. if an element B sits on top of element A, a child element of A can never be higher than B (older version IE sucks)
  3. The main point about stacking contexts is that z-index can be used to rearrange the stacking order of elements only inside their own stacking context (reason of 4).

https://css-tricks.com/almanac/properties/z/z-index/

Clone this wiki locally