Image responsiveness with img - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Image responsiveness with img

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">
.box {<!--from  w ww  .j a va  2  s.  c  o  m-->
   width:100%;
   height:auto;
}

.box img {
   width:100%;
   max-width:100%;
   min-width:100%;
}
</style> 
 </head> 
 <body> 
  <div class="box"> 
   <img src="https://www.java2s.com/style/demo/Firefox.png"> 
  </div>  
 </body>
</html>

Related Tutorials