Referencing a .css file in github repo as stylesheet in a .html fileLink and execute external JavaScript file hosted on GitHubDoes GitHub Pages have a shortcut way of linking to files in its git repository?Changing nodes for images in d3.js force layout graphChrome userscript is not applying remote CSS stylesheetHow to add css to my page via Git Hub raw?Download single files from GitHubDownload a single folder or directory from a GitHub repoGitHub relative link in Markdown fileSee the size of a github repo before cloning it?What's the proper way to link to a CSS file within my GitHub?Delete forked repo from GitHubLink and execute external JavaScript file hosted on GitHubHotlink resources like JavaScript files directly from GitHubCan github be used to serve XML?Setting up Github Pages from a forked repo
Non-trope happy ending?
Why is it that I can sometimes guess the next note?
How does electrical safety system work on ISS?
Stack Interview Code methods made from class Node and Smart Pointers
What is Cash Advance APR?
Is it allowed to activate the ability of multiple planeswalkers in a single turn?
Plot of a tornado shape like surface
The Digit Triangles
Strong empirical falsification of quantum mechanics based on vacuum energy density?
A Trivial Diagnosis
How can I write humor as character trait?
Are Captain Marvel's powers affected by Thanos breaking the Tesseract and claiming the stone?
Pre-mixing cryogenic fuels and using only one fuel tank
Why does this expression simplify as such?
What features enable the Su-25 Frogfoot to operate with such a wide variety of fuels?
Did the UK lift the requirement for registering SIM cards?
What is the difference between lands and mana?
It grows, but water kills it
Biological Blimps: Propulsion
How to get directions in deep space?
Does the reader need to like the PoV character?
"It doesn't matter" or "it won't matter"?
Why can't the Brexit deadlock in the UK parliament be solved with a plurality vote?
Shouldn’t conservatives embrace universal basic income?
Referencing a .css file in github repo as stylesheet in a .html file
Link and execute external JavaScript file hosted on GitHubDoes GitHub Pages have a shortcut way of linking to files in its git repository?Changing nodes for images in d3.js force layout graphChrome userscript is not applying remote CSS stylesheetHow to add css to my page via Git Hub raw?Download single files from GitHubDownload a single folder or directory from a GitHub repoGitHub relative link in Markdown fileSee the size of a github repo before cloning it?What's the proper way to link to a CSS file within my GitHub?Delete forked repo from GitHubLink and execute external JavaScript file hosted on GitHubHotlink resources like JavaScript files directly from GitHubCan github be used to serve XML?Setting up Github Pages from a forked repo
I've got a repository on github with a .css file in it. Is there any way to have github serve this file in a way that I can consume it in a web page?
In other words, I'd like to be able to reference this source file at github directly, from an HTML file on my local computer or a live domain. Something like:
<link rel="stylesheet"
type="text/css"
href="http://github.com/foouser/barproject/master/xenu-is-my-lover.css"
/>
I've tried including a<link>
to the "raw" source file (http://raw.github.com...
), but github serves its Content-Type
as text/plain
, and consequently, Chrome and FF are not adding its content as CSS styles to the page—the file's data is being discarded and a warning is shown in the debugger consoles of the browsers.
github
add a comment |
I've got a repository on github with a .css file in it. Is there any way to have github serve this file in a way that I can consume it in a web page?
In other words, I'd like to be able to reference this source file at github directly, from an HTML file on my local computer or a live domain. Something like:
<link rel="stylesheet"
type="text/css"
href="http://github.com/foouser/barproject/master/xenu-is-my-lover.css"
/>
I've tried including a<link>
to the "raw" source file (http://raw.github.com...
), but github serves its Content-Type
as text/plain
, and consequently, Chrome and FF are not adding its content as CSS styles to the page—the file's data is being discarded and a warning is shown in the debugger consoles of the browsers.
github
1
possible duplicate of Link and execute external JavaScript file hosted on GitHub
– Troy Alford
Oct 24 '14 at 20:43
add a comment |
I've got a repository on github with a .css file in it. Is there any way to have github serve this file in a way that I can consume it in a web page?
In other words, I'd like to be able to reference this source file at github directly, from an HTML file on my local computer or a live domain. Something like:
<link rel="stylesheet"
type="text/css"
href="http://github.com/foouser/barproject/master/xenu-is-my-lover.css"
/>
I've tried including a<link>
to the "raw" source file (http://raw.github.com...
), but github serves its Content-Type
as text/plain
, and consequently, Chrome and FF are not adding its content as CSS styles to the page—the file's data is being discarded and a warning is shown in the debugger consoles of the browsers.
github
I've got a repository on github with a .css file in it. Is there any way to have github serve this file in a way that I can consume it in a web page?
In other words, I'd like to be able to reference this source file at github directly, from an HTML file on my local computer or a live domain. Something like:
<link rel="stylesheet"
type="text/css"
href="http://github.com/foouser/barproject/master/xenu-is-my-lover.css"
/>
I've tried including a<link>
to the "raw" source file (http://raw.github.com...
), but github serves its Content-Type
as text/plain
, and consequently, Chrome and FF are not adding its content as CSS styles to the page—the file's data is being discarded and a warning is shown in the debugger consoles of the browsers.
github
github
edited Oct 15 '11 at 21:08
user979672
asked Oct 15 '11 at 20:47
user979672user979672
77331231
77331231
1
possible duplicate of Link and execute external JavaScript file hosted on GitHub
– Troy Alford
Oct 24 '14 at 20:43
add a comment |
1
possible duplicate of Link and execute external JavaScript file hosted on GitHub
– Troy Alford
Oct 24 '14 at 20:43
1
1
possible duplicate of Link and execute external JavaScript file hosted on GitHub
– Troy Alford
Oct 24 '14 at 20:43
possible duplicate of Link and execute external JavaScript file hosted on GitHub
– Troy Alford
Oct 24 '14 at 20:43
add a comment |
5 Answers
5
active
oldest
votes
GitHub repos aren't web hosting, you should push that stuff up to a service specifically designed to serve files, like pages.github.com.
I don't think this is true. You can host static files on github, granted web hosting is better but it can work on github pages.
– 32423hjh32423
Aug 2 '18 at 13:58
add a comment |
Important: rawgit.com is shutting down. Read more about other alternatives here - https://rawgit.com/
Found something really cool. You get the raw link as: http://raw.github.com/...
Simply fetch the files from rawgit.com (or cdn.rawgit.com
) instead of raw.github.com
and DONE!
UPDATE:
You can also use raw.githack.com if you want to serves raw files directly from Bitbucket or GitLab
7
Thought this was a troll until it worked...
– SuperFamousGuy
May 31 '13 at 16:53
1
Just what I needed to serve the proper MIME type!
– Kevin M
Jun 20 '13 at 20:31
8
Keep in mind that you should not use rawgithub for production code.
– ricksmt
Oct 11 '13 at 16:04
this is seriously working, thanks for this trick :)
– Anirudha Gupta
Oct 6 '17 at 12:17
Mind Blown. Private gists and repo's don't work. just as an FYI
– Mark Carpenter Jr
Jan 11 '18 at 19:42
add a comment |
- First Visit RawGit as suggested earlier
- Next copy your file path from github into the RawGit box
- RawGit will automatically produce two refrences to your web page
- The Development and Production refrence
- refrence the development link in your webpage if you are still developing
- save/upload then reload your webpage
- if there was no change it means your browser has saved your former refrence
- clear your browser data then reload
- Hope that helps?
add a comment |
You have to use RawGit which, is a part of MaxCDN, serve files directly from the GitHub repository with the correct content type header.
Full tutorial, click here
add a comment |
Check out https://gitcdn.link/ . Seems to work well.
Rawgit.com has shut down.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f7780550%2freferencing-a-css-file-in-github-repo-as-stylesheet-in-a-html-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
GitHub repos aren't web hosting, you should push that stuff up to a service specifically designed to serve files, like pages.github.com.
I don't think this is true. You can host static files on github, granted web hosting is better but it can work on github pages.
– 32423hjh32423
Aug 2 '18 at 13:58
add a comment |
GitHub repos aren't web hosting, you should push that stuff up to a service specifically designed to serve files, like pages.github.com.
I don't think this is true. You can host static files on github, granted web hosting is better but it can work on github pages.
– 32423hjh32423
Aug 2 '18 at 13:58
add a comment |
GitHub repos aren't web hosting, you should push that stuff up to a service specifically designed to serve files, like pages.github.com.
GitHub repos aren't web hosting, you should push that stuff up to a service specifically designed to serve files, like pages.github.com.
answered Oct 17 '11 at 7:56
TekkubTekkub
22.2k22420
22.2k22420
I don't think this is true. You can host static files on github, granted web hosting is better but it can work on github pages.
– 32423hjh32423
Aug 2 '18 at 13:58
add a comment |
I don't think this is true. You can host static files on github, granted web hosting is better but it can work on github pages.
– 32423hjh32423
Aug 2 '18 at 13:58
I don't think this is true. You can host static files on github, granted web hosting is better but it can work on github pages.
– 32423hjh32423
Aug 2 '18 at 13:58
I don't think this is true. You can host static files on github, granted web hosting is better but it can work on github pages.
– 32423hjh32423
Aug 2 '18 at 13:58
add a comment |
Important: rawgit.com is shutting down. Read more about other alternatives here - https://rawgit.com/
Found something really cool. You get the raw link as: http://raw.github.com/...
Simply fetch the files from rawgit.com (or cdn.rawgit.com
) instead of raw.github.com
and DONE!
UPDATE:
You can also use raw.githack.com if you want to serves raw files directly from Bitbucket or GitLab
7
Thought this was a troll until it worked...
– SuperFamousGuy
May 31 '13 at 16:53
1
Just what I needed to serve the proper MIME type!
– Kevin M
Jun 20 '13 at 20:31
8
Keep in mind that you should not use rawgithub for production code.
– ricksmt
Oct 11 '13 at 16:04
this is seriously working, thanks for this trick :)
– Anirudha Gupta
Oct 6 '17 at 12:17
Mind Blown. Private gists and repo's don't work. just as an FYI
– Mark Carpenter Jr
Jan 11 '18 at 19:42
add a comment |
Important: rawgit.com is shutting down. Read more about other alternatives here - https://rawgit.com/
Found something really cool. You get the raw link as: http://raw.github.com/...
Simply fetch the files from rawgit.com (or cdn.rawgit.com
) instead of raw.github.com
and DONE!
UPDATE:
You can also use raw.githack.com if you want to serves raw files directly from Bitbucket or GitLab
7
Thought this was a troll until it worked...
– SuperFamousGuy
May 31 '13 at 16:53
1
Just what I needed to serve the proper MIME type!
– Kevin M
Jun 20 '13 at 20:31
8
Keep in mind that you should not use rawgithub for production code.
– ricksmt
Oct 11 '13 at 16:04
this is seriously working, thanks for this trick :)
– Anirudha Gupta
Oct 6 '17 at 12:17
Mind Blown. Private gists and repo's don't work. just as an FYI
– Mark Carpenter Jr
Jan 11 '18 at 19:42
add a comment |
Important: rawgit.com is shutting down. Read more about other alternatives here - https://rawgit.com/
Found something really cool. You get the raw link as: http://raw.github.com/...
Simply fetch the files from rawgit.com (or cdn.rawgit.com
) instead of raw.github.com
and DONE!
UPDATE:
You can also use raw.githack.com if you want to serves raw files directly from Bitbucket or GitLab
Important: rawgit.com is shutting down. Read more about other alternatives here - https://rawgit.com/
Found something really cool. You get the raw link as: http://raw.github.com/...
Simply fetch the files from rawgit.com (or cdn.rawgit.com
) instead of raw.github.com
and DONE!
UPDATE:
You can also use raw.githack.com if you want to serves raw files directly from Bitbucket or GitLab
edited Dec 28 '18 at 16:17
answered Feb 13 '13 at 20:33
Kushagra GourKushagra Gour
2,79221319
2,79221319
7
Thought this was a troll until it worked...
– SuperFamousGuy
May 31 '13 at 16:53
1
Just what I needed to serve the proper MIME type!
– Kevin M
Jun 20 '13 at 20:31
8
Keep in mind that you should not use rawgithub for production code.
– ricksmt
Oct 11 '13 at 16:04
this is seriously working, thanks for this trick :)
– Anirudha Gupta
Oct 6 '17 at 12:17
Mind Blown. Private gists and repo's don't work. just as an FYI
– Mark Carpenter Jr
Jan 11 '18 at 19:42
add a comment |
7
Thought this was a troll until it worked...
– SuperFamousGuy
May 31 '13 at 16:53
1
Just what I needed to serve the proper MIME type!
– Kevin M
Jun 20 '13 at 20:31
8
Keep in mind that you should not use rawgithub for production code.
– ricksmt
Oct 11 '13 at 16:04
this is seriously working, thanks for this trick :)
– Anirudha Gupta
Oct 6 '17 at 12:17
Mind Blown. Private gists and repo's don't work. just as an FYI
– Mark Carpenter Jr
Jan 11 '18 at 19:42
7
7
Thought this was a troll until it worked...
– SuperFamousGuy
May 31 '13 at 16:53
Thought this was a troll until it worked...
– SuperFamousGuy
May 31 '13 at 16:53
1
1
Just what I needed to serve the proper MIME type!
– Kevin M
Jun 20 '13 at 20:31
Just what I needed to serve the proper MIME type!
– Kevin M
Jun 20 '13 at 20:31
8
8
Keep in mind that you should not use rawgithub for production code.
– ricksmt
Oct 11 '13 at 16:04
Keep in mind that you should not use rawgithub for production code.
– ricksmt
Oct 11 '13 at 16:04
this is seriously working, thanks for this trick :)
– Anirudha Gupta
Oct 6 '17 at 12:17
this is seriously working, thanks for this trick :)
– Anirudha Gupta
Oct 6 '17 at 12:17
Mind Blown. Private gists and repo's don't work. just as an FYI
– Mark Carpenter Jr
Jan 11 '18 at 19:42
Mind Blown. Private gists and repo's don't work. just as an FYI
– Mark Carpenter Jr
Jan 11 '18 at 19:42
add a comment |
- First Visit RawGit as suggested earlier
- Next copy your file path from github into the RawGit box
- RawGit will automatically produce two refrences to your web page
- The Development and Production refrence
- refrence the development link in your webpage if you are still developing
- save/upload then reload your webpage
- if there was no change it means your browser has saved your former refrence
- clear your browser data then reload
- Hope that helps?
add a comment |
- First Visit RawGit as suggested earlier
- Next copy your file path from github into the RawGit box
- RawGit will automatically produce two refrences to your web page
- The Development and Production refrence
- refrence the development link in your webpage if you are still developing
- save/upload then reload your webpage
- if there was no change it means your browser has saved your former refrence
- clear your browser data then reload
- Hope that helps?
add a comment |
- First Visit RawGit as suggested earlier
- Next copy your file path from github into the RawGit box
- RawGit will automatically produce two refrences to your web page
- The Development and Production refrence
- refrence the development link in your webpage if you are still developing
- save/upload then reload your webpage
- if there was no change it means your browser has saved your former refrence
- clear your browser data then reload
- Hope that helps?
- First Visit RawGit as suggested earlier
- Next copy your file path from github into the RawGit box
- RawGit will automatically produce two refrences to your web page
- The Development and Production refrence
- refrence the development link in your webpage if you are still developing
- save/upload then reload your webpage
- if there was no change it means your browser has saved your former refrence
- clear your browser data then reload
- Hope that helps?
answered Aug 16 '14 at 13:46
Toye_BrainzToye_Brainz
857
857
add a comment |
add a comment |
You have to use RawGit which, is a part of MaxCDN, serve files directly from the GitHub repository with the correct content type header.
Full tutorial, click here
add a comment |
You have to use RawGit which, is a part of MaxCDN, serve files directly from the GitHub repository with the correct content type header.
Full tutorial, click here
add a comment |
You have to use RawGit which, is a part of MaxCDN, serve files directly from the GitHub repository with the correct content type header.
Full tutorial, click here
You have to use RawGit which, is a part of MaxCDN, serve files directly from the GitHub repository with the correct content type header.
Full tutorial, click here
edited Dec 15 '16 at 19:33
answered Jan 9 '16 at 19:02
Vishal ChopraVishal Chopra
16128
16128
add a comment |
add a comment |
Check out https://gitcdn.link/ . Seems to work well.
Rawgit.com has shut down.
add a comment |
Check out https://gitcdn.link/ . Seems to work well.
Rawgit.com has shut down.
add a comment |
Check out https://gitcdn.link/ . Seems to work well.
Rawgit.com has shut down.
Check out https://gitcdn.link/ . Seems to work well.
Rawgit.com has shut down.
answered Mar 8 at 0:00
SquirrlSquirrl
1,46252858
1,46252858
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f7780550%2freferencing-a-css-file-in-github-repo-as-stylesheet-in-a-html-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
possible duplicate of Link and execute external JavaScript file hosted on GitHub
– Troy Alford
Oct 24 '14 at 20:43