Responsive sprite background image - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Responsive sprite background 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">
#square {<!--   w ww  .  j a  v a 2s  .c o m-->
   width:81%;
   height:301px;
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png') top left no-repeat;
   border:solid 3px;
   text-shadow:white 0px 0px 3px;
   font-size:17px;
   background-size:81%;
   background-position:-71% 31%;
}
</style> 
 </head> 
 <body> 
  <div id="square"> 
  </div>  
 </body>
</html>

Related Tutorials