Difference between auto, 0, and no z-index?

前端 未结 5 830
温柔的废话
温柔的废话 2021-02-11 17:12

What is the difference between:

  1. z-index: auto
  2. z-index: 0
  3. no z-index at all

All the above sc

5条回答
  •  不要未来只要你来
    2021-02-11 17:51

    z-index: auto

    Sets the stack order equal to its parents. This is default.

    z-index:0

    does nothing

    z-index:not

    Sets the stack order equal to its parents same as auto.

    z-index:inherit

    Specifies that the z-index should be inherited from the parent element

    Reference for further reading and testing:

    Link

提交回复
热议问题