Inline-block elements positioned side by side - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

Inline-block elements positioned side by side

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">
.image_series_container {<!--  w w w  . j av a  2  s  .  c om-->
   height:144px;
   width:100%;
   margin-top:18px;
   max-width:501px;
}

.image_series {
   color:Chartreuse;
   font-size:2.4em;
   line-height:29px;
   text-align:center;
   border:6px dashed yellow;
   border-radius:14px;
   margin-right:11px;
   width:46%;
   height:86%;
   display:inline-block;
   vertical-align:top;
}

.image_cover {
   width:100%;
   height:100%;
}
</style> 
 </head> 
 <body> 
  <div class="image_series_container"> 
   <div class="image_series"> 
    <br>Lorem ipsum dol 
    <br>Lorem i 
    <!-- Add images when you have images.
                  <img class="image_cover" src = "https://www.java2s.com/style/demo/Safari.png">
               --> 
   </div> 
   <!-- To add more images. --> 
   <div class="image_series"> 
    <img class="image_cover" src="https://www.java2s.com/style/demo/Opera.png"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials