Hide overflow on elements with fixed position

后端 未结 3 943
迷失自我
迷失自我 2020-12-31 14:10

Is there any way to hide the overflow of a fixed div with a container? I thought fixed inside fixed would do it, but it seems it\'s not the case. The only w

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-31 14:29

    Unfortunately it seems to be impossible to nest a fixed element within another element (fixed or not) and expect the outer element to wrap it and hide any overflow.

    The only thing I can think of is setting the inner div to position:absolute instead of fixed. Here is an example based on your jsfiddle: jsfiddle.net/pjFa6/15 .

提交回复
热议问题