How do I create a background image that scales to the browser window?

  • 0
  • 2
  • Question
  • Updated 3 years ago
  • Answered
Photo of Christopher9421

Christopher9421

  • 212 Points 100 badge 2x thumb

Posted 3 years ago

  • 0
  • 2
Photo of William S

William S

  • 18,858 Points 10k badge 2x thumb
Official Response
Hello,

Try putting the following code in the HTML Head tag section while having an image selected to be the background. Note: This will stretch the image to be the background, so if the image is small it may appear pixilated, and will need to be placed on every page.. I would recommend doing this with a large photo. 

<style>body {      background-repeat: no-repeat;
      background-size: cover;
      }
</style>