Search code examples
htmlcssgithubfrontendbackground-image

The Background Image for my Personal Website not showing up. I think my path is correct url('../images/IMG_1.png) but not sure


I'm pretty new to cs and wanted to try and create a personal website for fun. I've attempted many times to try and use an image from my files to be the background for my personal website. I tried to read up on how paths work but I can't seem to be able to set the background to the image.

Please check my github repository for all the code: https://github.com/HarnoorDhillon/HarnoorDhillon.github.io


Solution

  • I just checked out your git repo and it looks like there's an error with your image. It's broken or something. But for the style.css you might want to put background-image: url("../images/IMG_1.png"); under the body instead of html as that is generally where that sort of stuff goes.

    For example,

    body { 
        background-image: url("../images/IMG_1.png");
       /* Other stuff like background-color, font, etc.*/
    }