Using margin along side position - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

Using margin along side position

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,<!--from  www .j a v  a  2s . com-->
body {
   margin:0;
   height:100%;
}

.page {
   min-height:100%;
   margin:0 auto;
   width:301px;
   background:green
}
</style> 
 </head> 
 <body> 
  <div class="page">
    Lorem ips 
  </div>  
 </body>
</html>

Related Tutorials