Connecting CSS to my HTML on github #88763
Select Topic AreaQuestion Bodyhello! |
Replies: 2 comments 7 replies
|
Hi Klaudiablo, Using a raw.githubusercontent.com file as a link to your CSS is not recommended, as the raw mode serves files with the Content-Type: text/plain header, which means that neither HTML, CSS, nor JS can be used directly in web pages. To link a CSS file hosted on GitHub to an HTML file, you can use a relative or absolute path. If the CSS file is in the same repository as the HTML file, you can use a relative path, as demonstrated by the code snippet below:
|
|
The issue is likely due to using a "raw" GitHub URL or an incorrect path. Use a relative path in your HTML section: |

Hi Klaudiablo,
Using a raw.githubusercontent.com file as a link to your CSS is not recommended, as the raw mode serves files with the Content-Type: text/plain header, which means that neither HTML, CSS, nor JS can be used directly in web pages.
To link a CSS file hosted on GitHub to an HTML file, you can use a relative or absolute path. If the CSS file is in the same repository as the HTML file, you can use a relative path, as demonstrated by the code snippet below:
<link href="./style.css" type="text/css" rel="stylesheet">