Center a Div inside another 100% width div - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Width

Description

Center a Div inside another 100% width div

Demo Code

ResultView the demo in separate window

<html>
 <head></head> 
 <body> 
  <div style="background-color: blue; width: 100%;"> 
   <div style="background-color: yellow; width: 940px; margin: 0 auto;">
     Test <!--from www  .  jav a 2  s.c om-->
   </div> 
  </div>  
 </body>
</html>

Related Tutorials