Why is z-index ignored with position:static?

后端 未结 2 2061
不知归路
不知归路 2020-11-28 13:31

See this comment from jquery-ui

// Ignore z-index if position is set to a value where z-index is ignored by the browser
// This makes behavior of this functi         


        
2条回答
  •  北海茫月
    2020-11-28 14:10

    Because position: static means "Ignore all the positioning instructions from left, top, z-index, etc.".

    'z-index'
    Value:      auto |  | inherit
    Initial:    auto
    Applies to:     positioned elements
    

    — http://www.w3.org/TR/CSS21/visuren.html#z-index

    An element is said to be positioned if its 'position' property has a value other than 'static'.

    — http://www.w3.org/TR/CSS21/visuren.html#positioned-element

提交回复
热议问题