Stretch HTML container to fit size of background image - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image

Description

Stretch HTML container to fit size of background image

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <style type="text/css">
div .img {
   visibility:hidden;
}

div {<!--from   ww  w .  j a  v a 2s  .com-->
   background:url('http://www.java2s.com/style/demo/Google-Chrome.png') top left no-repeat;
}
</style> 
 </head> 
 <body> 
  <div> 
   <img src="https://www.java2s.com/style/demo/Safari.png"> 
  </div>  
 </body>
</html>

Related Tutorials