# Can one link a button css stylesheet?

**URL:** <https://forum.freecodecamp.org/t/can-one-link-a-button-css-stylesheet/254647>\
**Category:** General\
**Created:** [January 26, 2019, 8:14pm UTC](https://forum.freecodecamp.org/t/can-one-link-a-button-css-stylesheet/254647 "2019-01-26T20:14:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xiija](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/xiija/32/108018_2.png) [@Xiija](https://forum.freecodecamp.org/u/Xiija)\
**Post date:** [January 26, 2019, 8:14pm UTC](https://forum.freecodecamp.org/t/can-one-link-a-button-css-stylesheet/254647/1 "2019-01-26T20:14:44Z")

</div>

I was trying to use a linked stylesheet to style buttons.  
is this even possible?  
the Pen… [https://codepen.io/Xiija/pen/daMYvG](https://codepen.io/Xiija/pen/daMYvG)

the stylesheet ( just a saved text file on github?)  
[https://raw.githubusercontent.com/Xiija/CSS/master/test01.css](https://raw.githubusercontent.com/Xiija/CSS/master/test01.css)

thanx for any help or explanation.

---

<div class="post-metadata">

**Author:** ![AwesomeIndustry](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/awesomeindustry/32/24864_2.png) [@AwesomeIndustry](https://forum.freecodecamp.org/u/AwesomeIndustry)\
**Post date:** [January 26, 2019, 8:31pm UTC](https://forum.freecodecamp.org/t/can-one-link-a-button-css-stylesheet/254647/2 "2019-01-26T20:31:48Z")

</div>

It appears that your text file is encoded as `text/plain` whereas the browser wants a `text/css` format. It appears your stylesheet is not loading at all.  
 ![35%20PM](https://global.discourse-cdn.com/freecodecamp/original/3X/7/a/7a90981c2715f59681a39fba4b943ba64b4750b1.png)  
I found a [post on StackOverflow](https://stackoverflow.com/questions/7780550/referencing-a-css-file-in-github-repo-as-stylesheet-in-a-html-file) that might help:

> Found something really cool. You get the raw link as: `http://raw.github.com/...`  
> Simply fetch the files from [rawgit.com](https://rawgit.com/) (or `cdn.rawgit.com` ) instead of `raw.github.com` and DONE!  
> **UPDATE:**  
> You can also use [raw.githack.com](https://raw.githack.com/) if you want to serves raw files directly from **Bitbucket** or **GitLab**

So, your link would become [https://cdn.rawgit.com/Xiija/CSS/master/test01.css](https://cdn.rawgit.com/Xiija/CSS/master/test01.css).

P.S: For styling buttons i just use an `<a>` element with `display: block;`, because it’s more cross-compatible (but if this works for you that’s fine; just a personal preference!)

---

<div class="post-metadata">

**Author:** ![Xiija](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/xiija/32/108018_2.png) [@Xiija](https://forum.freecodecamp.org/u/Xiija)\
**Post date:** [January 26, 2019, 9:33pm UTC](https://forum.freecodecamp.org/t/can-one-link-a-button-css-stylesheet/254647/3 "2019-01-26T21:33:10Z")

</div>

Most Excellent! tysm 🙂

I wish i could learn to use the debug console better heh.

Any idea how people use js libraries hosted on git?  
i tried a js solution and could not get it to load either ?

the pen: ( working now with the alt site !)  
[https://codepen.io/Xiija/pen/LqNGBe?editors=1011](https://codepen.io/Xiija/pen/LqNGBe?editors=1011)

the js on git:  
Blocked -  
[https://cdn.rawgit.com/Xiija/JS/master/button-01.js](https://cdn.rawgit.com/Xiija/JS/master/button-01.js)

Raw -  
[https://raw.githubusercontent.com/Xiija/JS/master/button-01.js](https://raw.githubusercontent.com/Xiija/JS/master/button-01.js)

\*\*\*Edit:  
found an alt since rawgit is shutting down:  
[https://www.jsdelivr.com/rawgit](https://www.jsdelivr.com/rawgit)

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:05pm UTC](https://forum.freecodecamp.org/t/can-one-link-a-button-css-stylesheet/254647/4 "2021-01-17T20:05:58Z")

</div>

Closed on January 17, 2021, 8:05pm UTC


