Give a margin bottom to a div positioned absolutely and height: 100vh - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Absolute Position

Description

Give a margin bottom to a div positioned absolutely and height: 100vh

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 {<!--  ww w.j  a v a  2  s  .  co  m-->
   margin:0;
}

.container {
   -webkit-box-sizing:padding-box;
   -moz-box-sizing:padding-box;
   box-sizing:padding-box;
   width:301px;
   height:100vh;
   padding:0 21px 21px 0;
   margin:0 auto;
}

.inner {
   width:100%;
   height:100%;
   background:yellow;
   box-shadow:red 11px 11px 11px;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="inner"> 
    <div class="aux"></div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials