Set Center position for a div element that has display:inline-block - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

Set Center position for a div element that has display:inline-block

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">
.wrapper {<!--  w ww  .j a  va  2 s .c  om-->
   text-align:center;
}

.box {
   display:inline-block;
}
</style> 
 </head> 
 <body> 
  <div class="wrapper"> 
   <div class="box">
     Lorem 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials