0

Folder StrucThis is so simple, but nothing is working for me. I am trying to have a background of a local picture I own. I have read a bunch of other sites, and no one is consistent. I have tried every combo of ../ or ./ or file/// or someone even said web/port_back. Half include "" within the () and half don't. Tried every combo with that. Cleared my cache data constantly just in case that has affected it.

My Image is located /Portfolio/port_back.JPG and My css is located /Portfolio/static/index_app/index.css

CSS:

body {
  background-image: url("../../port_back.jpg");
  /* background-repeat: no-repeat; */
  background-size: cover;
}
5
  • It will help us a lot if you share your folder structure to the project. Also, what bundler you use? Commented Aug 20, 2020 at 5:52
  • 1
    it depends - what is the size of your picture? is your server case sensitive? background of some other element may be overriding the color. do you have content inside body to get some width and height so that the background picture should be displayed Commented Aug 20, 2020 at 5:53
  • Please inspect in browser the , check the url of image. Commented Aug 20, 2020 at 6:00
  • Waqas Raja - 877 x 433 px...Rayees AC - It says image not found in my terminal Commented Aug 20, 2020 at 8:43
  • Also, I keep getting this error - Not Found: /favicon.ico Commented Aug 20, 2020 at 9:09

1 Answer 1

4

You should go 3 folders back, try:

background-image: url("../../../port_back.jpg");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.