Layout footer 100% width and content till footer - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Footer

Description

Layout footer 100% width and content till footer

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
body, html {
   margin:0;
   padding:0;
   width:100%;
}

body {<!--   ww w.  j av a  2 s .c om-->
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png') center repeat-y;
}

#header {
   height:161px;
   background:Chartreuse;
}

#content {
   width:501px;
   margin:0 auto;
}

#footer {
   position:fixed;
   bottom:0;
   background:yellow;
   width:100%;
   height:41px;
}
</style> 
 </head> 
 <body> 
  <div id="header">
    Lorem ip 
  </div> 
  <div id="content"> 
   <p>Lorem i</p> 
   <p>Lorem i</p> 
   <p>Lorem i</p> 
   <p>Lorem i</p> 
   <p>Lorem i</p> 
   <p>Lorem i</p> 
   <p>Lorem i</p> 
   <p>Lorem i</p> 
   <p>Lorem i</p> 
   <p>Lorem i</p> 
   <p>Lorem i</p> 
   <p>Lorem i</p> 
   <p>Lorem i</p> 
   <p>Lorem i</p> 
   <p>Lorem i</p> 
  </div> 
  <div id="footer">
    Lorem ip 
  </div>  
 </body>
</html>

Related Tutorials