Background-size and background-position on an img tag - HTML CSS CSS Property

HTML CSS examples for CSS Property:background-size

Description

Background-size and background-position on an img tag

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
 </head> <!--from  w  w  w .  j av a2  s.  co  m-->
 <body> 
  <img border="0" style="display:block; width:120px; height:120px; background-color:red; padding:9px; background:url(http://www2.cnrs.fr/sites/communique/image/mona_unvarnish_web_image.jpg) no-repeat; background-position:-100px -40px;" src="https://www.java2s.com/style/demo/Google-Chrome.png">  
 </body>
</html>

Related Tutorials