# How can my student use a image as a background for an HTML website?

**URL:** <https://forum.code.org/t/how-can-my-student-use-a-image-as-a-background-for-an-html-website/36992>\
**Category:** CS Discoveries\
**Tags:** csd-unit-2\
**Created:** [September 29, 2022, 7:13pm UTC](https://forum.code.org/t/how-can-my-student-use-a-image-as-a-background-for-an-html-website/36992 "2022-09-29T19:13:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdiaz1](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/rdiaz1/32/9589_2.png) [@rdiaz1](https://forum.code.org/u/rdiaz1)\
**Post date:** [September 29, 2022, 7:13pm UTC](https://forum.code.org/t/how-can-my-student-use-a-image-as-a-background-for-an-html-website/36992/1 "2022-09-29T19:13:18Z")

</div>

Hello I have a student who wants to use an image as a background for his website. How can he make this happen?

---

<div class="post-metadata">

**Author:** ![edavis](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/edavis/32/4927_2.png) [@edavis](https://forum.code.org/u/edavis)\
**Post date:** [September 30, 2022, 1:48am UTC](https://forum.code.org/t/how-can-my-student-use-a-image-as-a-background-for-an-html-website/36992/2 "2022-09-30T01:48:08Z")

</div>

I love that your student is wanting to go the extra mile. You can share this link to [w3schools](https://www.w3schools.com/cssref/pr_background-image.asp) with your student if you’d like them to try to figure it out for themselves. I also included a screenshot of the CSS in Web Lab of an easy way to make a background picture. Have fun!

 ![background_image](https://us1.discourse-cdn.com/flex016/uploads/codeorgforum/original/2X/3/39cec53bc8a56d641387774f254dedfbcb843c34.png)

---

<div class="post-metadata">

**Author:** ![wutadam](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/wutadam/32/7711_2.png) [@wutadam](https://forum.code.org/u/wutadam)\
**Post date:** [September 30, 2022, 3:39am UTC](https://forum.code.org/t/how-can-my-student-use-a-image-as-a-background-for-an-html-website/36992/3 "2022-09-30T03:39:35Z")

</div>

If you’d like it to fit perfectly, use this solution from [CSS Tricks](https://css-tricks.com/perfect-full-page-background-image/):

```css
html { 
  background: url(images/bg.jpg) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

```

---

<div class="post-metadata">

**Author:** ![rdiaz1](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/rdiaz1/32/9589_2.png) [@rdiaz1](https://forum.code.org/u/rdiaz1)\
**Post date:** [September 30, 2022, 7:57pm UTC](https://forum.code.org/t/how-can-my-student-use-a-image-as-a-background-for-an-html-website/36992/4 "2022-09-30T19:57:12Z")

</div>

Thank you so much for your help. My student was able to get this working
