Make images move under each other, when using a responsive theme - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Make images move under each other, when using a responsive theme

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">
div.tablecategory {
   display:table;
   width:100%;
   float:left;
   background-size:cover;
   width:100%;
   height:100%;
}

div.tr_cat {
   display:table-row;
   width:11%;
}

div.td_cat {
   display:table-cell;
   text-align:center;
   background-color:Chartreuse;
   border:2px solid yellow;
   float:left;
}

div.td_cat a {
   width:100%;
   height:100%;
   display:block;
   background:blue;
}

div.td_cat a:hover {
   background:pink;
}

div.td_cat img {
   border:2px solid OrangeRed;
   width:100%;
}
</style> <!--from  w ww  .ja  v  a 2 s.com-->
 </head> 
 <body> 
  <div class="tablecategory"> 
   <div class="tr_cat"> 
    <div class="td_cat"> 
     <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> 
    </div> 
    <div class="td_cat"> 
     <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> 
    </div> 
    <div class="td_cat"> 
     <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> 
    </div> 
    <div class="td_cat"> 
     <img src="https://www.java2s.com/style/demo/InternetExplorer.png" alt=""> 
    </div> 
    <div class="td_cat"> 
     <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> 
    </div> 
    <div class="td_cat"> 
     <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> 
    </div> 
    <div class="td_cat"> 
     <img src="https://www.java2s.com/style/demo/Opera.png" alt=""> 
    </div> 
    <div class="td_cat"> 
     <img src="https://www.java2s.com/style/demo/Safari.png" alt=""> 
    </div> 
   </div> 
   <div class="tr_cat"> 
    <div class="td_cat"> 
     <a href="#">Lorem ipsum </a> 
    </div> 
    <div class="td_cat"> 
     <a href="#">Lorem ipsum </a> 
    </div> 
    <div class="td_cat"> 
     <a href="#">Lorem ipsum </a> 
    </div> 
    <div class="td_cat"> 
     <a href="#">Lorem ipsum </a> 
    </div> 
    <div class="td_cat"> 
     <a href="#">Lorem ipsum </a> 
    </div> 
    <div class="td_cat"> 
     <a href="#">Lorem ipsum </a> 
    </div> 
    <div class="td_cat"> 
     <a href="#">Lorem ipsum </a> 
    </div> 
    <div class="td_cat"> 
     <a href="#">Lorem ipsum </a> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials