make images and <figures> in my website responsive - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

make images and <figures> in my website responsive

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">
@media only screen and (max-width: 700px)  {
   #imgDiv {<!--from  w  w  w  . j a  va  2 s .c o  m-->
      -moz-transform:scale(0.8);
      -ms-transform:scale(0.8);
      -webkit-transform:scale(0.8);
      transform:scale(0.8);
   }
   
   #imgDiv {
      -moz-transform:scale(0.8);
      -ms-transform:scale(0.8);
      -webkit-transform:scale(0.8);
      transform:scale(0.8);
   }

}

@media only screen and (max-width: 450px)  {
   #imgDiv {
      -moz-transform:scale(0.5);
      -ms-transform:scale(0.5);
      -webkit-transform:scale(0.5);
      transform:scale(0.5);
   }
   
   #imgDiv {
      -moz-transform:scale(0.5);
      -ms-transform:scale(0.5);
      -webkit-transform:scale(0.5);
      transform:scale(0.5);
   }

}
</style> 
 </head> 
 <body> 
  <div id="imgDiv"> 
   <img src="https://www.java2s.com/style/demo/Safari.png" style> 
   <div> 
    <figure id="figureDiv"> 
     <img src="https://www.java2s.com/style/demo/Google-Chrome.png"> 
     <figure> 
     </figure> 
    </figure> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials