How To Deliver Github CSS and Js Files For Free?


So whats up everybody. Today I will share my experience and you will get to know how you can host and deliver css and js files of github for free. What does it even mean? It means you can easyily host css and js files on github and use it on the web. So let's begin.

Host & Deliver CSS Files From Github

If you don't have a github account. Create one now. Once you create your account create a public repository. Create a new file and name it anything for example myfirst.css is name. So when you end the name with extension it will automatically detect. For css it's a .css file so end it with extension. Now upload the the file on your repository and click on three dot and view the raw file. You will get the raw link of your CSS file. 
We are now successfully hosting a CSS file on github. But using the raw URL we can't use it on web. For this we need a content delivery network. So you can go for or CDN. Both are free and fast. 

If you are using jsdelivr go to the site click  three dot, then tools and then convert from github option. Now a new page will be loaded put the URL that you hat copied from github which is raw URL like this and after putting the url you will get the CDN URL like this ''. Now the CDN URL can be used to deliver CSS file on web. 

Similarly if you are using go to their website click on menu and then convert. Put the raw github URL. You will get the CDN URL of staticaaly like this ''. Now the URL is also ready to use on web.

Deliver Js files.

I already mentioned how you can deliver CSS file. Similarly when creating a file on github. Upload your js code and make sure to end the file name with .js, because it's JavaScript extension. Then copy the .js file raw github URL. The rest process of jsdelivr and statically is same as CSS.

How To Use The CDN URL?

You can use the code of CSS like this

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

Similarly for js files you can use this tag like beolow to deliver js on your code

<script src=""></script>

I hope that you liked that information.

About the Author

I am Infokeeda. Subscribe this blog for amazing and useful contents.

Post a Comment

It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.