Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>JS Bin</title>
  </head>
  <body>
    <div class="container"></div>
    
  </body>
</html>
 
.container {
  height: 500px;
  background-image: url("https://placekitten.com/g/200/300");
  
  
  /* try changing the values of background-size 
     to the following values
     
     - auto
     - contain
     - cover
     - <length> (enter in a pixel value: background-size: 100px)
     - <percentage> (enter in a % value: background-size: 30%)
  
     
  */
  
  background-size: contain;
  
  /* background-size can also be used in combination
     with the other background image properties such as 
     background-repeat & background-position 
  */
  
  /* uncomment the properties below and experiment with
     with different combinations 
  */
  
  
  /* background-repeat: no-repeat; */
  /* background-position: center center; */
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x