Creating a responsive grid, stacks, with responsive images - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image

Description

Creating a responsive grid, stacks, with responsive images

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">
#content {<!--from  www  . j a  va 2 s . co m-->
   width:91%;
   margin-top:61px;
   margin-left:6%;
   margin-right:6%;
}

.product img {
   max-width:100%;
}

body {
   background-color:Chartreuse;
}

.product {
   width:51%;
   display:block;
   float:left;
}

@media screen and (min-width:450px)  {
   .product {
      width:34.4%;
      display:block;
      float:left;
   }

}
</style> 
 </head> 
 <body> 
  <div id="content"> 
   <div class="product"> 
    <img src="https://www.java2s.com/style/demo/Opera.png"> 
   </div> 
   <div class="product"> 
    <img src="https://www.java2s.com/style/demo/Opera.png"> 
   </div> 
   <div class="product"> 
    <img src="https://www.java2s.com/style/demo/Opera.png"> 
   </div> 
   <div class="product"> 
    <img src="https://www.java2s.com/style/demo/Safari.png"> 
   </div> 
   <div class="product"> 
    <img src="https://www.java2s.com/style/demo/Firefox.png"> 
   </div> 
   <div class="product"> 
    <img src="https://www.java2s.com/style/demo/Opera.png"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials