JSDELIVR

For hosting and delivering files like JavaScript libraries, CSS frameworks, fonts, and other assets.

jsdelivr.com

You can use jsDelivr to load a CSS file directly from a GitHub repository. Here’s how:

Example: Load a CSS File from GitHub

If you have a CSS file stored in a GitHub repo, for example:

GitHub Repo: https://github.com/user/repo
CSS File Path: styles/main.css
Branch: main

You can load it in your HTML like this:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/user/repo@main/styles/main.css">

How This Works

  • gh → Tells jsDelivr you’re loading from GitHub.
  • user/repo → Replace this with the actual GitHub username/repository.
  • @main → Specifies the branch (main, master, or a specific tag/version).
  • /styles/main.css → The file path inside the repository.