Content appearing behind fixed header

送分小仙女□ 提交于 2019-12-01 17:18:40

问题


I fixed the header section of a website, but the first div of the page appears behind the header; instead of starting from the end of the header.


回答1:


When you apply position: fixed or position: absolute the element is being removed from the document flow, so the elements that come after treat it as a non-existent. That's why your div jumps up. To fix that apply a margin-top that equals to your header height - http://jsfiddle.net/2xjES/



来源:https://stackoverflow.com/questions/11126482/content-appearing-behind-fixed-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!