Background Image Help

heres the code and for some reason the background image wont appear

1 Like

Haven’t you forgotten a forward slash in the path you passed to the css prop? :thinking:
Just guessing ^^

dont think so as ive tried background-color and that has worked

does your image name starts with a dot? or did you put the dot there for any reason?

it doesnt but when searching for a solution i noticed some people had a dot in front, ive tried without a dot also

there should be a slash after that dot

hasnt worked either, ive tried a few things and none have worked haha

what are these things that you have tried?

where is the image in relation to the rest of your files?

consider also that if there is nothing in your body, the image could not appear for that reason

ive tried linking it to html tag also. I originally had the image in an images folder and have now removed it, tried putting the style code in the html file, changing the name of it, tried background instead of background-image.

Can you try these?

HTML File: change ‘css/style.css’ to ‘style.css’
CSS File: change ‘background-image’ to ‘background’

style.css is in a css folder and ive tried background

also tried background-color and this worked so dont think its a problem with css file

can you show us the website with the code side by side? also you really might have file directory issues, but i wouldn’t know because you gave us limited reference.

btw, i said background, not background-color

I’ve tried background also. What else would you guys need? The website is just a blank page

heres how i have it Screen Shot 2020-03-22 at 15.52.44

You won’t ever get it passing in that format. Here is my suggestion for you:

Remember: background image is a CSS property. That said, the index page is unable to locate the image. Copy the image folder and save it inside the css folder. Therefore, The CSS Link in your html head section will help locate all files and folder inside the css folder.
Having done that, your css image property should appear in this format:
background-image: url(‘images/bg.jpg’);

Furthermore, The CSS Link seems incomplete:

This has worked!!! Thanks a lot guys for your help