Add element to bottom of page - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Page

Description

Add element to bottom of page

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">
*,
*:before,<!--from   www. ja v a 2  s .c o  m-->
*:after {
   margin:0;
   padding:0;
   box-sizing:border-box;
}

html,
body,
#parent {
   width:100%;
   height:100%;
   position:relative;
}

#centerWrapper {
   width:100%;
   height:100%;
   display:flex;
   align-items:center;
   justify-content:center;
   flex-direction:column;
}

#centerWrapper * {
   width:100px;
   height:100px;
}

#firstChild {
   background-color:Chartreuse;
}

#secondChild {
   background-color:yellow;
}

#thirdChild {
   background-color:blue;
   position:absolute;
   bottom:0;
   height:100px;
   width:100px;
   left:51%;
   transform:translateX(-51%);
}
</style> 
 </head> 
 <body> 
  <div id="parent"> 
   <div id="centerWrapper"> 
    <div id="firstChild"></div> 
    <div id="secondChild"></div> 
   </div> 
   <div id="thirdChild"></div> 
  </div>  
 </body>
</html>

Related Tutorials