When I create a dynamic content from database and fill up <div id="content-pri">, the footer doesn't go to the bottom of content, rather stays at the bottom of the view port. Any idea how I can fix this?

PHP Code:
/* commented backslash hack \*/ 
htmlbody{height:100%;} 
/* end hack */
html,body {margin:0;padding:0}
body{text-align:center/* centre for ie5.+*/

#container{
min-height:100%;
/*margin-bottom:-50px;*/

height:auto;
width100%;
margin-leftauto;
margin-rightauto;
positionrelative;
text-alignleft;
background-color#1b000ff
}
html #container{
height:100%;
width950px/*box model hack for ie5.+*/
w\idth950px;
}
#footer {
text-alignright;
width:100%; 
/*width:950px;*/
position:absolute;
bottom:0;
left:0;
height:50px;
background-color#ffa200;
 
}
#clearfooter{clear:both;height:50px;width:100%}
div>{margin:0}
html>body #minHeight{float:left;width:0px;height:100%;margin-bottom:-52px;} /*safari wrapper */
 
#content {
                
positionrelative/* Needed for Safari */
                
marginauto/* Takes care of horizontal alignment in standards compliant browsers */
                
text-alignleft;
                
width260px;
                
height200px;
                
background-color#0dff00;
            
}

#container-head {
  
text-alignright;    
  
background#fdff00;
}

#main-nav {
marginauto;
  
text-alignright;
  
padding0 1em;
  
background-color#ff00fa
}

#content-pri {
  
  
width80%;
  
floatright;
  
background-color#d2a5ff
}

#content-sec {
  
  
padding1em 0;
  
width20%;
  
floatleft;
  
background#49e9ff
}

#footer .inner {padding: 0px 20px}

body {
  
background#dcdcdc;
  
font-family"lucida grande"tahomaverdanaarialsans-serif;
  
font-size11px;
  
margin0px;
  
padding0px;
  } 
The html page has this format:
<div id="container">

<div id="main-nav"></div>

<div id="content-sec"></div>

<div id="content-pri"></div>

<div id="clear-footer"></div>

</div>

<div id="footer">
<div class="inner"></div>
</div>