Css and html making a picture fit the background - HTML CSS CSS Property

HTML CSS examples for CSS Property:background

Description

Css and html making a picture fit the background

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">

#bio{<!--from w ww.  j  av  a 2s  .  co m-->
   min-height: 100%;
   min-width: 1024px;
   /* Set up proportionate scaling */
   width: 100%;
   height: auto;
   /* Set up positioning */
   position: fixed;
   top: 0;
   left: 0;
   background-image: url("https://www.java2s.com/style/demo/InternetExplorer.png");
   background-size: cover;
   background-position: center center;
}


      </style> 
 </head> 
 <body> 
  <div id="bio"></div>  
 </body>
</html>

Related Tutorials