Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

CSS display issues with github pages

Having trouble displaying my css on github pages. Everything works when ran in default browser (as seen in image) however when I published to pages it fails to load with the css. I have tried changing the href tag but not sure what I’m doing wrong at this point after a couple attempts at changing around the link.

Link to Repo: https://github.com/trentstanley92/02ProfessionalPortfolio
Link to Pages: https://trentstanley92.github.io/02ProfessionalPortfolio/

Default browser css loading

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I have tried changing the href link to 02ProfessionalPortfolio/Assets/styles.css tag a couple times. Ultimately the one linked above is my final attempt after starting at link rel="stylesheet" href="=./Assets/styles.css". I expected the second line to pull up the css on its own, however after it didnt I messed around with the capitalization and the ./ at the beginning and when those did not work I resulted to the first and final attempt, which did not work either.

>Solution :

Use your web browser’s Developer tools.

Your page is trying to load this:
https://trentstanley92.github.io/02ProfessionalPortfolio/02ProfessionalPortfolio/Assets/styles.css

But the file lives here:
https://trentstanley92.github.io/02ProfessionalPortfolio/Assets/styles.css

Your index.html is already at 02ProfessionalPortfolio, so you just need to write it as follows to hit the relative address:

<link rel="stylesheet" href="Assets/styles.css" />
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading