Michiel
Michiel

Reputation: 8083

Placing footer under content doesn't seem to work

I'm trying to get the footer on a webpage under my content, regardless of the length of the content. For some reason, it doesn't want to.

HTML:

<div class="container">
    <div class="navigatie">
        <ul>
            <a class="navigatielink" href="index.php?page=home"><li class="navigatieli navigatie1">Home</li></a>
            <a class="navigatielink" href="index.php?page=info"><li class="navigatieli navigatie2">Info</li></a>
            <a class="navigatielink" href="index.php?page=agenda"><li class="navigatieli navigatie3 ">Agenda</li></a>
            <a class="navigatielink" href="index.php?page=fotos"><li class="navigatieli navigatie4">Foto's</li></a>
            <a class="navigatielink" href="index.php?page=contact"><li class="navigatieli navigatie5">Contact</li></a>
            <a class="navigatielink" href="index.php?page=gastenboek"><li class="navigatieli navigatie6">Gastenboek</li></a>
        </ul>
    </div>
    <?php
        //include the page content
        include_once ("content/".$_PAGE.'.php');
    ?>
</div>
<div class="clear"></div>
<div class="footer">

CSS:

.container {
    width: 1000px;
    margin: auto;
    height: auto;
}

.clear {
    clear: both;
}
.footer {
    background-image: url("images/css/footer.png");
    height: 500px;
}

.navigatie {
    font-family: Rockwell;
    height: 45px;
    width: 980px;
    margin:auto;
    margin-top: 15px;
    font-size: 24px; 
    border: 1px solid #c3c3c3;
    background: #fff;
}

I already tried to give the .container a height of 100% and played with positioning, but I don't seem to be able to get this footer under the content regardless of the length of it...
Any more suggestions?

EDIT:
It's about this website

Upvotes: 0

Views: 203

Answers (2)

Dev
Dev

Reputation: 791

try adding a float:left; to .footer class

.footer{
  float:left;
}

if you can get a jsFiddle up it'll help massively

Upvotes: 0

Subhajit
Subhajit

Reputation: 1987

As you have not mentioned the style which has been used for class="navigatie" I guess you have used float property there. If so then add overflow:hidden to .container. For e.g.,

.container {
    width: 1000px;
    margin: auto;
    height: 100%; /* For IE6 */
    overflow:hidden /* For all other browsers*/
}

If my assumption is not right, then please provide the full list of elements present inside .contaier and also the full stylesheet.

EDIT: Try this

 HTML:
   <div class="contentPart">
      <?php
        //include the page content
       include_once ("content/".$_PAGE.'.php');
      ?>
 </div>

CSS:
.contentPart {
     overflow:hidden;
     height:100%;
}

Upvotes: 1

Related Questions