Hello I want to put a background image to my html page unfortunately it does not want to be displayed even though I specified the relative path of the image in url in the css how to do? I also have this error Failed to load resource: net::ERR_FILE_NOT_FOUND I do not understand
My css path is also the right one, in fact it works when I load an image in html but when I want to load a background image in css it does not work.
body {
background-image : url('images/nightvision.jpg');
}
I want the image as the background
EDIT : I think it's working with
background-image : url('../images/nightvision.jpg');
CodePudding user response:
Are you sure you are using the right image extension? Like .png
, .jpeg
?
If that is clear, perhaps you could try to be more specific and add something like:
url('../images/nightvision.jpg');