CSS - Responsive design for keeping an image inside a desktop-frame image - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

CSS - Responsive design for keeping an image inside a desktop-frame image

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">
.container {<!--  ww  w. ja  v  a2  s  .com-->
   width:81%;
   margin:0 auto;
}

.frame {
   background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png');
   background-size:100%;
   background-position:center;
   margin:0 auto;
   max-width:652px;
   height:359px;
}

.screenshot {
   position:relative;
   top:2px;
   left:6px;
   height:100px;
}

@media screen and (max-width: 479px)  {
   .screenshot {
      height:41px;
   }

}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <ul class="frame"> 
    <li> <img class="screenshot" src="https://www.java2s.com/style/demo/Firefox.png"> </li> 
    <li> <img class="screenshot" src="https://www.java2s.com/style/demo/InternetExplorer.png"> </li> 
    <li> <img class="screenshot" src="https://www.java2s.com/style/demo/InternetExplorer.png"> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials