Header and footer with fixed position while content is scrollable?

css, css-position, html

Solution

The easiest fix for this is to add padding equivalent to the height of your static header and footer:

#content {
    width: 80%;
    margin: 0 auto;
    padding: 60px 0;
}

JSfiddle

Problem

I'm trying to make a website where header and footer have fixed position while content scrolls in the middle. ``` <header style="position:fixed"></header> <div id="content">some content</div> <footer style="position:fixed"></footer> ``` I created what I thought would work but it doesn't. Here's jsFiddle with the whole thing. As you can see, part of content is hidden under the footer and beyond (I can't see 'HELLOWEEN' in the end). What must I change to fix it? Thanx

Original source