# Jekyll GitHub Pages no styles applied

**URL:** <https://talk.jekyllrb.com/t/jekyll-github-pages-no-styles-applied/3690>\
**Category:** Help\
**Created:** [December 8, 2019, 11:11am UTC](https://talk.jekyllrb.com/t/jekyll-github-pages-no-styles-applied/3690 "2019-12-08T11:11:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tonterias](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/tonterias/32/2099_2.png) [@Tonterias](https://talk.jekyllrb.com/u/Tonterias)\
**Post date:** [December 8, 2019, 11:11am UTC](https://talk.jekyllrb.com/t/jekyll-github-pages-no-styles-applied/3690/1 "2019-12-08T11:11:42Z")

</div>

I can see my jekyll localhost with styles but they are not applied on gh-pages (in a new project). I:

- $ jekyll new prle (:\>cd prle)

- $ bundle exec jekyll serve # I get the styles right

- $ git init

- $ git checkout -b gh-pages

- $ git add .

- $ git commit -am “Initial commit prle”

I create a new repo prle:

- $ git remote add origin [https://github.com/Tonterias/prle.git](https://github.com/Tonterias/prle.git)
- $ git push -u origin gh-pages

But when I check [https://myaccount.github.io/prle/](https://myaccount.github.io/prle/) the styles are gone.

Is .gitignore responsible for this?

Thanks for your help

I do not see the solution here: [Jekyll website behaves like there is no css file](https://talk.jekyllrb.com/t/jekyll-website-behaves-like-there-is-no-css-file/2820/3)

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [December 8, 2019, 5:12pm UTC](https://talk.jekyllrb.com/t/jekyll-github-pages-no-styles-applied/3690/2 "2019-12-08T17:12:43Z")

</div>

did you look at the website in the Web Tools of your browser? most likely the console will show that your css is 404. That is because when you have the site as a GH project, the actual site path is as a sub folder of your username. So the path to the css needs to include the project name - it is not /assets/css.

This is what baseurl is for - in the config you can set a value for baseurl that is your project name followed by a slash. Then you can prepend baseurl or siteurl(?) to all your static files to get the correct path.

---

<div class="post-metadata">

**Author:** ![chuckhoupt](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/chuckhoupt/32/523_2.png) [@chuckhoupt](https://talk.jekyllrb.com/u/chuckhoupt)\
**Post date:** [December 8, 2019, 9:27pm UTC](https://talk.jekyllrb.com/t/jekyll-github-pages-no-styles-applied/3690/3 "2019-12-08T21:27:34Z")

</div>

Some possible problems that are visible in the `prle` repo:

- Use of Jekyll 4, rather then 3
- Jekyll Gem needs to be deleted from `Gemfile`
- Missing `github-pages` Gem in `Gemfile`
- `Gemfile.lock` and `_site/` shouldn’t be committed

Consult Github’s instructions for using Jekyll. In particular, steps 7-9 cover the required Jekyll setup:

[https://help.github.com/en/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll](https://help.github.com/en/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll)
