I have an HTML file with a subdirectory called img
with an image called debut_dark.png
. In my CSS file, I have:
body {
backgro
I have the same issue. But it works properly for me
background: url(../img/debut_dark.png) repeat
Make sure your body has a height, f.ex:
body {
background: url(/img/debut_dark.png) repeat;
min-height: 100%;
}
If your path is correct then I think you don't have any element in you body section. Just define the height of the body and your code will work.
I had the same issue. For me it worked with:
background: url("../img/green.jpg") no-repeat center bottom/cover;
height: 100vh;
background : url (/img.. )
NOTE: If you have your css in a different folder, ensure that you start the image path with THE FORWARD SLASH.
It worked for me. !
You have to use a relative path in the URL. I think you made two folders in the root directory where your index.html resides. One is 'CSS' folder & another is 'img' folder.
Now, if you have to access 'img' folder in css files. So you have to go back once in root directory using "../" syntax. Then move to the 'img' folder using "../img" syntax. Then write the image name "../img/debut_dark.png".
body {
background: url("../img/debut_dark.png") repeat 0 0;
}