Background-size with background-position and scale the position - HTML CSS CSS Property

HTML CSS examples for CSS Property:background-size

Description

Background-size with background-position and scale the position

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">
p {<!--from  ww w . jav a 2  s .c om-->
   margin:0;
   display:inline-block;
   border:11px solid Chartreuse;
}

a {
   display:block;
   width:92px;
   height:92px;
   background:black url('https://www.java2s.com/style/demo/Google-Chrome.png') no-repeat 0 0;
   background-size:100% auto;
   background-position:0 4.29%;
}

a:hover {
   width:121px;
   height:121px;
}
</style> 
 </head> 
 <body>
   Lorem ipsum d 
  <br> 
  <p> <a href="#"></a> </p>  
 </body>
</html>

Related Tutorials