阅读背景:

保证金影响其他固定元素头寸

来源:互联网 

I wanted to set a top header in a fixed position and have content scroll underneath it and came across some strangeness. If I set a margin-top to the content div that margin would also affect the header and move it down even though it's set to position:fixed. I found a workaround by setting the content div to position:relative and using top: to offset it the same amount, but I find it strange that a non-nested div can affect a fixed-positioned element and would like to know why it happens.I wanted to set a top header in a fixed positio




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: