Reputation: 473
I have a mainContainer on my site that I want to add a background image to. When I try to add the image I use this css
#mainContainer {
background-image: url(images/bg.jpg);
background-size: cover;
height: 100%;
width: 100%;
}
The image is a safe size. I think 1000x1000 or something around there. When I try to refresh the page I get a strange error:
I am using bootstrap4. Does the error on top have anything to do with my image not displaying or is it something in the css?
Also this is how my file structure looks if it helps:
Thanks!
Upvotes: 1
Views: 53
Reputation: 1414
Put this.
#mainContainer {
background-image: url(../images/bg.jpg);
background-size: cover;
height: 100%;
width: 100%;
}
Upvotes: 3
Reputation: 5828
The image file is not in the folder. You probably want to change it to ../images/bg.jpg
to if it is in assets/images/
folder instead of assets/css/images/
.
Upvotes: 3