How to link index.html to css file for github page

Tags: html,css,github,directory,github-pages

Problem :

I'm hosting a github page and want to link index.html to main.css, which is in a folder called "stylesheets" also in the root directory.

my file structure:

   - main.css

right now I have:

<link type="text/css" rel="stylesheet" href="/stylesheets/main.css" />

in the <head>, but this doesn't work?

Solution :

First, you should create gh-pages branch that special branch of GitHub.
You can find and create it in setting page of you project by the button Automatic page generator.
The branch will map to the doamin

So the path should be stylesheets/main.css not /stylesheets/main.css

    CSS Howto..

    How does one change the colour of a div based on current time?

    how can I center button below my text while using bootstrap css?

    How to avoid overlapping text using CSS?

    How to override a css !important property using jQuery with transitions

    How to apply a CSS height setting to all child elements?

    How can I use an inline style to add a shadow around the used portion of my page?

    How to add container without destroying table

    How to override default Polymer CSS

    How to overlay a div over a canvas CSS

    CSS - how to fix the hover?

    iPhone iOS how to send an HTML email with CSS styling?

    How do I give a WordPress Custom Menu item an id or class for CSS targeting?

    How to get different height html divs to float up

    How to strike through obliquely with css

    How to CSS border spacing (or) padding background image separately?

    how to move image vertically with css [closed]

    How to break text inside a parent div with white-space:nowrap in CSS?

    How do I vertically align text inside an anchor element, which is nested within an unordered list

    How to overwrite styling in Twitter Bootstrap

    How to make sure my css overlay is on top at any site?

    How to add a line break inside with CSS?

    how to nest css boxes with relative positioning and absolute positioning

    How to keep banner animations running while changing webpages [closed]

    Using CSS to style a Sencha Touch form - how do I find the elements?

    How to make form line up?

    Show image in a div tag with it's real size using jquery/css/html

    How to divide a menu horizontaly between buttons , using CSS?

    How to change img margin inside a table using css hover

    how to use bootstrap's modal dialog only, instead of the whole bootstrap.css to aviod conflicting with my own css

    How to find if a request is for js or css in httpHandler