position 4 elements in stack - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

position 4 elements in stack

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">
.w3-card-4 {<!--   ww w  . ja  v  a  2  s  . co  m-->
   box-shadow:0 7px 7px 0;
   display:inline-block;
}

.w3-container {
   padding:0.2em 17px
}
</style> 
 </head> 
 <body> 
  <div class="w3-container"> 
   <h2>Lorem ipsu</h2> 
   <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed</p> 
   <div class="cont"> 
    <div class="w3-card-4" style="width:15%"> 
     <img src="https://www.java2s.com/style/demo/Safari.png" alt="face" style="width:100%"> 
     <div class="w3-container"> 
      <h4> <b>Lorem i</b> </h4> 
      <p>Lorem ips</p> 
     </div> 
    </div> 
    <div class="w3-card-4" style="width:15%"> 
     <img src="https://www.java2s.com/style/demo/Opera.png" alt="face" style="width:100%"> 
     <div class="w3-container"> 
      <h4> <b>Lorem i</b> </h4> 
      <p>Lorem ips</p> 
     </div> 
    </div> 
    <br> 
   </div> 
   <div class="cont"> 
    <div class="w3-card-4" style="width:15%"> 
     <img src="https://www.java2s.com/style/demo/Opera.png" alt="face" style="width:100%"> 
     <div class="w3-container"> 
      <h4> <b>Lorem i</b> </h4> 
      <p>Lorem ips</p> 
     </div> 
    </div> 
    <div class="w3-card-4" style="width:15%"> 
     <img src="https://www.java2s.com/style/demo/Opera.png" alt="face" style="width:100%"> 
     <div class="w3-container"> 
      <h4> <b>Lorem i</b> </h4> 
      <p>Lorem ips</p> 
     </div> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials