Javascript and images not working on github pages

Viewed 302
1 Answers

The base path of your site is /Industrious-Website, in your index.html you referenced:

<script src="/main.js"></script>

which will load https://lupe-fiasnow.github.io/main.js instead of https://lupe-fiasnow.github.io/Industrious-Website/main.js.

It should be (without the slash):

<script src="main.js"></script>

The same apply for the img tag source :

<img src="/img/person-3.jpg" alt="">

should be :

<img src="img/person-3.jpg" alt="">

Also in your css file, you have :

/* Showcase */
.showcase {
  background-color: #000;
  height: 55vh;
  background: linear-gradient(rgba(244, 56, 56, 0.5), rgba(0, 0, 0, .8)),
    url(/img/skyline.jpg) center no-repeat;   <================== this line
  background-size: cover;
}
.info-mid{
  background: linear-gradient(rgba(244, 56, 56, 0.5), rgba(0, 0, 0, .8)),
    url(/img/skyline.jpg) center no-repeat fixed; <================== this line
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
}

/img/skyline.jpg will load https://lupe-fiasnow.github.io/img/skyline.jpg which doesn't exist, you want https://lupe-fiasnow.github.io/Industrious-Website/img/skyline.jpg. Update with url(img/skyline.jpg) would work

Related