I have this:

<div id="header"></div>
<div id="body">
  <div id="..."></div>
  <div id="..."></div>

  <div id="content"></div>
<div id="footer"></div>

and css:

#body { width: 100%; margin 0 auto; }
#content {   position: absolute;   height: 200px; width: 100%; }
#footer {   height: 63px;   clear:both; }

Now result: content div with much text and footer under text.

How can I make my footer under all content-area?

2 answers

This was chosen as the best answer

If your HTML is exactly as you have mentioned, then the div#body does not have enough content to make the footer go below the height of #content. You can specify:

div#body {
min-height: 200px;

and for IE 6:

div#body {

will put the footer below the content area.

Answered almost 10 years ago by Divya Manian
PaulBM 103

Off the top of my head, I'd say remove the position: absolute. Also you have colon missing after margin in the #body CSS.

Generally I only use position:absolute if the containing object has position:relative set, and I'm after positioning something exactly within it's container.

Oh and divs will be 100% width unless you specify a width.

Answered almost 10 years ago by PaulBM
  • I need in absolute, cause content should be over other divs from body-div. Maybe, there are another ways to do that? Ockonal almost 10 years ago