0

Possible Duplicate:
make div's height expand with its content

On my website you can see that I fixed the footer of the page at the bottom. It needs to be visible at all times because of our sponsors, that's why I fixed it.

Now the problem is that a part of the content is hidden behind the footer. I was able to fix this by adding a large height to the .container_12 div in css like this:

.container_12 { height: 1500px; margin-left: auto; margin-right: auto; width: 960px; }

But that's not a proper solution: for pages with only a little content it's way too high and are able to scroll all the way down leaving the content area all black; and when pages would grow in the future the height of 1500px could become insufficient.

Anyway, I just want it to fit, but don't know how to do it.

I hope anyone is able to help me!

Cheers guys

Community
  • 1
  • 1
Stein
  • 21
  • 1
  • check this post http://stackoverflow.com/questions/1709442/make-divs-height-expand-with-its-content – 000 Aug 24 '12 at 11:40
  • what have you done to your html/css! too many overflow: hidden; and position: fixed;. but for fast way do as @Burntime suggested. – Ghassan Elias Aug 24 '12 at 11:41
  • thanks for the comment! where can I delete overflow hidden and position fixed? – Stein Aug 24 '12 at 13:36

1 Answers1

1

the fastest way I see is to add margin-bottom: 360px; to .container_12

Burntime
  • 2,334
  • 2
  • 15
  • 20
  • it worked, but why so much? the footer is not that high at all, but yet I need to put around 400px to make it work, like you said.. – Stein Aug 24 '12 at 13:36
  • I think its related to `body: { height: 100% }` there are a lot of redundant styles. Would take some time to find the exact reason. – Burntime Aug 24 '12 at 14:43