clayguthrie29
New Member
Hello all,
I'm attempting to position a div as 'fixed' at the top of a webpage i'm working on. The top div which would be the nav and/or logo area would be fixed at the top of the screen and would not scroll. The second div, the content div, would be placed directly below that div and so on down the page. Problem is, the second div slides up behind the fixed div rather than staying below it. How do i fix this? Here is an example:
http://jsfiddle.net/dcacM/
Notice the 2nd div, the gray one, is 300px tall however it only shows 200px below the the red div and the first 100px is hidden behind the red.
I have tried adding a top margin of 100px to the gray div, but it causes positioning problems when i have a link that points to another section of the same page. Thanks in advance.
I'm attempting to position a div as 'fixed' at the top of a webpage i'm working on. The top div which would be the nav and/or logo area would be fixed at the top of the screen and would not scroll. The second div, the content div, would be placed directly below that div and so on down the page. Problem is, the second div slides up behind the fixed div rather than staying below it. How do i fix this? Here is an example:
http://jsfiddle.net/dcacM/
Notice the 2nd div, the gray one, is 300px tall however it only shows 200px below the the red div and the first 100px is hidden behind the red.
I have tried adding a top margin of 100px to the gray div, but it causes positioning problems when i have a link that points to another section of the same page. Thanks in advance.