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
CodePudding user response:
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.*/
}
CodePudding user response:
Sidenote: That image is more than 3800 x 2600px and nearly 16MB, which is kinda huge, even for a full screen background image. You could comfortably half the dimensions (which would roughly quarter the file size/download time) with no discernible loss of visual clarity.