开发者

Make div with top margin ignore div above it

开发者 https://www.devze.com 2023-02-25 07:26 出处:网络
I have two divs, one above the other, i would like the bottom div to ignore the one above it. The bottom div has the top margin property. By ignore i mean i dont want the top div to be counted when it

I have two divs, one above the other, i would like the bottom div to ignore the one above it. The bottom div has the top margin property. By ignore i mean i dont want the top div to be counted when it开发者_如何学Go is using top margin (but rather to push against the wrapper which contains both divs.)


Just use absolute positioning for the top div.


If I understand correctly you could change the top div to position:absolute; which will take if out of the flow of the document.

0

精彩评论

暂无评论...
验证码 换一张
取 消