Custom css file for readme.md in a Github repo

GitHub does not allow for CSS to affect README.md files through CSS for security reasons (as if you could inject CSS into a ReadMe, you could easily launch a phishing attack). This includes both stylesheets referenced through <link rel> and inline styles used with <style>.

The readmes are in markdown syntax, so some styling can be done, such as adding colours through placeholder images, just like here on StackOverflow. For example, you can add red squares #f03c15 with the following:

- ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) `#f03c15`

You can also make use of things like diff, json, html, js and css to affect text colouring.

Leave a Comment