简体   繁体   中英

how to link css files in organization github pages

I'm trying to add an external css file in my index.html .

Organization-name - codehunks

My directory structure is as:

codehunks.github.io
    _layouts/
        style.css
    LICENSE.txt
    README.rst
    index.html

I tried adding it as:

<link rel="stylesheet" type="text/css" href="_layouts/styles.css"/>

but it didn't work. I searched and get to know that raw.github.com/../.. doesn't work in case of css/text

I found some articles adding it by providing link as [username].github.io/[repo]/[folder]/[filname] but this didn't work for my organization.

I tried adding it as codehunks.github.com/codehunks.github.io/_layouts/style.css but the link is giving me 404 not found response.

Any possible solution or I'm following something wrong.

Here's my page codehunks.github.io and here's my code Source Code

your style will work at /styles.css if you put it in the root, _layout folder is used by jekyll/ruby.

create a css folder in the root of your repo and put the style in there.

/css/style.css instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM