HTML CSS examples for CSS Layout:Responsive Layout
Make img responsive and fill into a div
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .wrapper {<!-- w w w .j a v a2s . c o m--> width:201px; height:301px; background:red; } .inner-wrapper { width:0; height:100%; } .inner-wrapper img { height:100%; } </style> </head> <body> <div class="wrapper"> <div class="inner-wrapper"> <img src="https://www.java2s.com/style/demo/Opera.png"> </div> </div> </body> </html>