1

so I have been working on my website for a few months now and the background image won't load.

This is what the CSS code looks like:

.main{
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.5)50%,rgb(0, 0, 0, 0.5)50%), url(file:///home/g7adz177a/Downloads/website%20background.png);
  background-position: center;
  background-size: cover;
  height: 109vh;
}

I expected it to work on GitHub pages because when I opened the HTML file, it worked on the browser.

https://avrydacool1.github.io/avrysartshow.github.io/ (the website)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • As an aside, you have an anchor element within a button element which is not 'legal' HTML. You could put your code through a validator to uncover such problems. As for the image, itseems as though you are trying to load an image from your local system which isn't going to work. – A Haworth Dec 02 '22 at 00:59

1 Answers1

0

Your background image seems to be loading now (you have embedded in the style sheet with commit e789643), probably because the previous url was not supported:

 url(https://github.com/AvryDaCool1/avrysartshow.github.io/blob/main/website%20background.png);

What might have worked is (as illustrated here):

 url(https://avrydacool1.github.io/avrysartshow.github.io/website%20background.png);
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250