Extending position absolute div outside overflow hidden div

前端 未结 5 900
伪装坚强ぢ
伪装坚强ぢ 2021-02-18 23:17

I\'ve haven\'t done css in several month so I might miss something simple, but whatever the solution is, I couldn\'t figure it out. So here is the problem.

Here is simpl

5条回答
  •  长情又很酷
    2021-02-18 23:48

    Overflow hidden can actually be ignored if the following rules are observed:

    • The overflowing child element has absolute positioning
    • The parent with overflow hidden has static positioning
    • A second parent wrapper with relative positioning is added

    HTML

    (Overflowing the wrapper)

    CSS

    .outer-wrapper {
      position: relative;
    }
    .wrapper {
      overflow: hidden;
    }
    .overflowed {
      position: absolute;
    }
    

    FIDDLE http://jsfiddle.net/vLsmmrz6/

提交回复
热议问题