Search code examples
csspositionabsolute

CSS Absolute Positioning - Following Div


I have a banner set up at the top of my site, it has position absolute, so that I can set a height of 100% so that the background image takes up the whole of the screen that the user sees.

I then go to put in another section to be underneath the banner, but instead of the new div showing below the banner, it shows over it at the top of the page.

Hope I've made sense :/

Help!!!


Solution

  • Try using vh for height, and not using absolute positioning. Basically:

    #banner {
      height:100vh;
      width:100%;
    }