Centering large backgrounds - HTML CSS CSS Property

HTML CSS examples for CSS Property:background

Description

Centering large backgrounds

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">

#DivWrapper {<!--from  www  .  j a  va  2 s.c o  m-->
   background: #EEE;
   width: 1900px;
   height: 1200px;
   position: absolute;
   left: 50%;
   margin-left: -950px;
   text-align: center;
}


      </style> 
 </head> 
 <body> 
  <div id="DivWrapper">
    Centered div 
  </div>  
 </body>
</html>

Related Tutorials