Content appearing behind fixed header

14,468

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/

Share:
14,468
adeniyi makinde
Author by

adeniyi makinde

Updated on June 16, 2022

Comments

  • adeniyi makinde
    adeniyi makinde about 2 years

    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.