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

  • 0
  • 2
  • Question
  • Updated 5 years ago
  • Answered
Archived and Closed

This conversation is no longer open for comments or replies and is no longer visible to community members.

Photo of Christopher9421


  • 222 Points 100 badge 2x thumb

Posted 5 years ago

  • 0
  • 2
Photo of William S

William S

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

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;