-1
我有两个div像这样:位置固定的div重叠
<div style="position:fixed;height:100px;top:0;left:0;right:0;z-index:999;">
// some fixed content here...
</div>
<div>
// some other content here...
</div>
正如你所看到的,第一个div有固定的位置。我遇到的问题是第二个div与第一个div重叠。任何想法如何我可以解决这个问题,同时保持我的第一个div fixed
,请不要在第二个div上添加某种填充顶部什么的?
谢谢
为什么你对填充顶部不利?如果你不想让它重叠,“position:fixed”是否正确? – davidpauljunior