Issue:
I was creating my personal page in git-page but CSS doesn’t load in Git page.
CSS doesn’t load in line our in file path and image/favicon doesnt load either.
I try videos in YouTube and ChatGPT answers, but I couldn’t.
What can I try next?
Links:
- https://github.com/Marcelo-Augustovs/portfolio – directory in gitHub
- https://marcelo-augustovs.github.io/portfolio/portfolio.html – hosting page in Git page
I only use HTML and CSS in this.
Tried
I tried changing the path of the CSS file and folders several times but didn’t work.
how (./cssLink ./imgPasteLink) – ( in head) –
(cssLink ,imgPasteLink)
in local host works normally.
I expected load css files and images in github-pages
marcelo augusto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
GitHub Pages calls the index.html
file from the root directory of your project. Therefore, you do not need to use the <base>
tag to point to the portfolio
directory.
On your local machine, you might be accessing the index.html
file from outside the portfolio
directory, which is why you may have added the <base>
tag. However, to ensure correct rendering on GitHub Pages, you should remove the following line from your index.html
file:
<base href="/portfolio/">
Instead, navigate to the portfolio directory on your local machine before opening the index.html file.