CSS Div Positioning With Content in middle - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

CSS Div Positioning With Content in middle

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 {<!--from   w  ww .ja  v  a  2 s  .  c  om-->
   margin:0 auto;
   width:901px;
}

div {
   font:bold 17px/2.6 Arial, sans-serif;
}

.first,
.second {
   float:left;
   padding:11px;
   color:Chartreuse;
}

.first {
   background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png');
}

.second {
   background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png');
}
</style> 
 </head> 
 <body> 
  <div id="wrapper"> 
   <div class="first"> 
    <p>Lorem ipsum dolor sit amet, consectetur adip</p> 
   </div> 
   <div class="second"> 
    <p>Lorem ipsum dolor sit amet, consectetur adip</p> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials