Home > Blockchain >  Background image won't load Html/css
Background image won't load Html/css

Time:11-07

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'); 
}

see how folder are organized exemple

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');
  • Related