Align footer to bottom - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Footer

Description

Align footer to bottom

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">
html, body {
   margin:0;
   padding:0;
   width:100%;
   max-height:1025px;
   height:100%;
   background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png');
   background-repeat:no-repeat;
   background-size:100% 100%;
}

.wrapper {<!--   ww  w  .  j a v  a 2s.com-->
   height:100%;
   border:2px solid Chartreuse;
   position:relative
}

.main {
   height:71%;
}

.header {
   height:16%;
}

#footer {
   position:absolute;
   height:16%;
   bottom:0;
   left:0;
   right:0;
}
</style> 
 </head> 
 <body> 
  <div id="wrapper" class="wrapper"> 
   <div id="header"> 
    <img src="https://www.java2s.com/style/demo/Google-Chrome.png" style="width:100%;"> 
   </div> 
   <div id="main">
     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, tincidunt tortor in, pharetra nisl. Maecenas aliquam luctus mauris, vitae venenatis diam imperdiet vel. Donec tortor diam, pretium vitae nibh vitae, consectetur lacinia sem. Proin luctus facilisis volutpat. Ut semper sit amet purus quis ornare. Quisque lobortis neque vitae tempor iaculis. Aliquam erat volutpat. Mauris tincidunt eget lacus eget 
   </div> 
   <div id="footer">
     Lorem ip 
    <img src="https://www.java2s.com/style/demo/Safari.png" style="width:100%; position: absolute; bottom: 0;"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials