Issue
Working on a website at the moment and want a background image for the body. I keep getting a Failed to load resource: net::ERR_FILE_NOT_FOUND
. Heres my css file:
body
{
background-image: url("C:\Users\jamie\Desktop\Work\Second Year\Web Design\CA2\Images\login.jpg");
}
Apologies if this question has been asked multiple times, but I've tried everything and have no idea whats going on, I ran developer mode and disabled cache on chrome, originally just had Images/login.jpg,I added quotes in the url()
and didn't add quotes I've tried all sorts of different images in different files. Even downloaded firefox and tried it there but to no luck.
Solution
How about you put the login.jpg in the same folder as the css file and change the css to
body
{
background-image: url("login.jpg");
}
An absolute path is not correct, please use a relative one :)
Folder structure
MyCoolWebApp
|-> stylesheet.css
|-> login.jpg
if you want to access a file that is located in a parent folder of your stylesheet.css file, then use url("../login.jpg");
Answered By - auo
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.