I'm really confused as to what i'm doing wrong here. The Background Image won't show up. CSS:
body {
background-image: url("images/alfredo_dover.jfif");
}
Any ideas? Thanks!
I'm really confused as to what i'm doing wrong here. The Background Image won't show up. CSS:
body {
background-image: url("images/alfredo_dover.jfif");
}
Any ideas? Thanks!
Try this solve and make you sure give the height.
background-image: url("../images/alfredo_dover.jfif");
You need to give it a background-size: cover
and give the html and body elements a height of 100%. You can also give it a background-position: center
if you want to center the image.
Also, you might want to try a ./
in front of your path, in case the base url is being rewritten by the base href tag:
enter code here
background-image: url("./images/alfredo_dover.jfif");
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
html,body{
height: 100%;
margin: 0;
}
body {
background-image: url("https://placekitten.com/400/400");
background-size: cover;
background-position: center;
}