Max-width img on responsive - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Max-width img on 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">
.row {<!-- w  w  w.  j  ava  2  s .c om-->
   height:100%;
   width:100%;
   display:table-row;
}

.cell-content {
   width:100px !important;
   margin:2%;
}

.cell-content img {
   max-width:91% !important;
   height:auto !important;
}

@media (max-width: 767px)  {
   .cell-content {
      width:91% !important;
   }

}
</style> 
 </head> 
 <body> 
  <div class="row"> 
   <div class="cell-content">
     Lorem ipsum dolor sit amet, consectetur adipiscin 
    <br> 
    <img src="https://www.java2s.com/style/demo/Opera.png" border="0" alt="" width="800"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials