我有两个独立的DIV,一个是
position:fixed
的通知栏,另一个是主容器。当我为container
设置一些margin-top
时,这也会使我的通知栏被推出来!这里有个演示:http://jsfiddle.net/Zh9k8/2/。我知道我可以用top:0
将它固定在页面顶部,但我想知道为什么会发生这种情况。