css not working on github pages

rusne picture rusne · Aug 24, 2018 · Viewed 15.7k times · Source

I can't get my CSS to show on the site. I really can't figure out what I'm doing wrong here, I'm very new to all of this so I'm sure there's something I just can't see.

here is the live site https://rusne118.github.io/mile-stone-one/4

here is my repo https://github.com/rusne118/mile-stone-one

here is my css in my html

here is my files on cloud9

Answer

Tomasz Błachut picture Tomasz Błachut · Aug 24, 2018

Remember that GitHub pages are scoped with repo names.

You are including your CSS with

<link rel="stylesheet" href="/css/style.css">

This resolves to https://rusne118.github.io/css/style.css

but you want https://rusne118.github.io/mile-stone-one/css/style.css

Simply change link tag to

<link rel="stylesheet" href="/mile-stone-one/css/style.css">