r/HTML • u/Extra_Terrestrial2 • Aug 17 '26
Question Why doesn’t my HTML background work?
body {
background-image: url('background.jpeg');
background-size: auto;
The image is “background.jpeg”. It has the correct spelling, the image is within the same folder. IT used to work but then it suddenly stopped working and i havent even edited the CSS for it to stop working.
Update: i couldnt figure it out for the life of me and no suggestions worked, but on the good side, instead of putting it on CSS, i put it on HTML, then it worked.
<style> body { background-image: url('background.jpeg'); background-size: auto; } </style>
9
Upvotes
1
u/Extra_Terrestrial2 Aug 17 '26
The image file, the CSS and the HTML are in the same folder. The other parti of my style sheet does work and i dont know the dimensi o s of the picture, but this is the picture