Why it's not displaying my background image?


Hello, after launching the website it’s throwing an error that it couldnt find an ‘bg.jpg’ image. Why is that happening? Here is the screenshot of my path to the file.

Hello, bartek.

For future posts, please include a link to a CodePen (or similar), or at the very least, paste your code in the forum. Not a screenshot - this is not very helpful.

To answer your question: the url method of background-image accepts a string as an argument. W3Schools

Hope this helps.

you need set set background-image as follows :

background-image:url(../media/bg.jpg);

because your stylesheet directory is different from your image directory

1 Like