Add margin on both sides of background - HTML CSS CSS Property

HTML CSS examples for CSS Property:margin-left

Description

Add margin on both sides of background

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">
.container {<!--  w  ww  .ja v  a2  s . c o m-->
   box-sizing:border-box;
   height:100vh;
   margin-left:100px;
   margin-right:100px;
   background-color:Chartreuse;
}
</style> 
 </head> 
 <body> 
  <div class="container">
    asdasdasd 
  </div>  
 </body>
</html>

Related Tutorials