Position:fixed within position:fixed: which browser is correct?

后端 未结 2 1282
轻奢々
轻奢々 2021-02-14 15:43

Positioning a fixed element inside another fixed element is behaving differently in Chrome / Safari vs Firefox.

This answer explains well the expected behavior for a fixe

2条回答
  •  臣服心动
    2021-02-14 16:30

    So, I think problem has arisen due to the bug in implementation of left in Firefox.

    When hovering .wrapper, .header should get new left value from its parent .wrapper i.e. 0px. When hovering .wrapper, the left position of .header should be calculated using the left value from its parent .wrapper as no explicit left value is given to .header.

    I think its due to bug in Firefox. If you activate :hover pseudo class of .wrapper using Firebug or the default developer tool, the left position of .header is maintained like in Chrome (but in sudden manner).

    Tested on Firefox 49.0.2 and Chrome 54.0.2840.71

提交回复
热议问题