# Not able to include back-ground image

**URL:** <https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553>\
**Category:** General\
**Created:** [July 19, 2020, 2:04pm UTC](https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553 "2020-07-19T14:04:55Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![lalitkumarji195](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lalitkumarji195](https://forum.freecodecamp.org/u/lalitkumarji195)\
**Post date:** [July 19, 2020, 2:04pm UTC](https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553/1 "2020-07-19T14:04:55Z")

</div>

body { background-image: url("C:\Users\lalit kumar\Desktop\HTML Document\LALIT\_PHOTO2"); } This is a heading

This is a red paragraph

H2O is the formula of water and superscript

* * *

---

<div class="post-metadata">

**Author:** ![saadanerdetbare](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/saadanerdetbare/32/106470_2.png) [@saadanerdetbare](https://forum.freecodecamp.org/u/saadanerdetbare)\
**Post date:** [July 19, 2020, 2:08pm UTC](https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553/2 "2020-07-19T14:08:54Z")

</div>

> [@lalitkumarji195](#):
>
> url(“C:\Users\lalit kumar\Desktop\HTML Document\LALIT\_PHOTO2”);

Probably the culprit is the path. This may work if you are on a development machine locally but the image has to go somewhere where the webserver can link to it  
/Jakob

---

<div class="post-metadata">

**Author:** ![sobadrdb](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sobadrdb](https://forum.freecodecamp.org/u/sobadrdb)\
**Post date:** [July 19, 2020, 2:10pm UTC](https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553/3 "2020-07-19T14:10:38Z")

</div>

hi @lalitkumarji195

why there is no image file type, like .jpeg, .png, .gif etc at your image file?

---

<div class="post-metadata">

**Author:** ![lalitkumarji195](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lalitkumarji195](https://forum.freecodecamp.org/u/lalitkumarji195)\
**Post date:** [July 19, 2020, 2:14pm UTC](https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553/4 "2020-07-19T14:14:28Z")

</div>

This is .jpg file and I have tried also with .jpg extension still it is not working .

---

<div class="post-metadata">

**Author:** ![thetradecoder](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/thetradecoder/32/172025_2.png) [@thetradecoder](https://forum.freecodecamp.org/u/thetradecoder)\
**Post date:** [July 19, 2020, 2:23pm UTC](https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553/5 "2020-07-19T14:23:21Z")

</div>

> [@lalitkumarji195](#):
>
> .jpg extension still it is not working .

you can try this way, right click on the image\>\>open with…\>\> (open it with any of your browser)\>\>then copy the url from the browser and paste it to your url code.

and if your index file is and the photo is in the same folder, you can try like this…

`./LALIT_PHOTO2.jpg`

---

<div class="post-metadata">

**Author:** ![iamjoydey](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/iamjoydey/32/169606_2.png) [@iamjoydey](https://forum.freecodecamp.org/u/iamjoydey)\
**Post date:** [July 19, 2020, 2:27pm UTC](https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553/6 "2020-07-19T14:27:09Z")

</div>

I’m assuming that you are using codepen. On online tools like codepen to use an image ,it should be hosted somewhere on the web to display them. Try putting the file somewhere online and then put the link inside the url(); I hope it will work 😁

Edit: You can use [imgbb.com](http://imgbb.com) to host image

---

<div class="post-metadata">

**Author:** ![lalitkumarji195](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lalitkumarji195](https://forum.freecodecamp.org/u/lalitkumarji195)\
**Post date:** [July 19, 2020, 2:30pm UTC](https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553/7 "2020-07-19T14:30:27Z")

</div>

I am not using codepen .I am using notepad and image is placed on my local desktop system .

---

<div class="post-metadata">

**Author:** ![lalitkumarji195](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lalitkumarji195](https://forum.freecodecamp.org/u/lalitkumarji195)\
**Post date:** [July 19, 2020, 2:33pm UTC](https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553/8 "2020-07-19T14:33:49Z")

</div>

Oh Great , Thanks Now It works . Please also tell me the reason that how ./LALIT\_PHOTO.jpg works

---

<div class="post-metadata">

**Author:** ![thetradecoder](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/thetradecoder/32/172025_2.png) [@thetradecoder](https://forum.freecodecamp.org/u/thetradecoder)\
**Post date:** [July 19, 2020, 2:41pm UTC](https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553/9 "2020-07-19T14:41:51Z")

</div>

> [@lalitkumarji195](#):
>
> ./

`./ ` it looks for any file in the same folder

---

<div class="post-metadata">

**Author:** ![lalitkumarji195](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lalitkumarji195](https://forum.freecodecamp.org/u/lalitkumarji195)\
**Post date:** [July 19, 2020, 2:47pm UTC](https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553/10 "2020-07-19T14:47:26Z")

</div>

Thank you , It was really Nice . I am going to log out now .But Next time When I will face a problem .How can I find you on this forum .

---

<div class="post-metadata">

**Author:** ![thetradecoder](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/thetradecoder/32/172025_2.png) [@thetradecoder](https://forum.freecodecamp.org/u/thetradecoder)\
**Post date:** [July 19, 2020, 2:51pm UTC](https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553/11 "2020-07-19T14:51:29Z")

</div>

> [@lalitkumarji195](#):
>
> “C:\Users\lalit kumar\Desktop\HTML Document\LALIT\_PHOTO2”

You also need to know why this does not work. for using a full path you need to follow the other option I mentioned above.

Well, if you want me to here, just include my name at the end your content like this @lalitkumarji195 just type `@thetradecoder`

---

<div class="post-metadata">

**Author:** ![lalitkumarji195](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lalitkumarji195](https://forum.freecodecamp.org/u/lalitkumarji195)\
**Post date:** [July 19, 2020, 2:55pm UTC](https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553/12 "2020-07-19T14:55:38Z")

</div>

ok , fine sir . Good Night

---

<div class="post-metadata">

**Author:** ![thetradecoder](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/thetradecoder/32/172025_2.png) [@thetradecoder](https://forum.freecodecamp.org/u/thetradecoder)\
**Post date:** [July 19, 2020, 2:57pm UTC](https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553/13 "2020-07-19T14:57:02Z")

</div>

@lalitkumarji195 Have a sweet dream!

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 6:45pm UTC](https://forum.freecodecamp.org/t/not-able-to-include-back-ground-image/410553/14 "2021-06-01T18:45:54Z")

</div>

Closed on June 1, 2021, 6:45pm UTC


