Custom css file for readme.md in a Github repo

帅比萌擦擦* 提交于 2020-06-22 11:36:12

问题


I am having trouble verifying the name of the .css file that will modifying the readme.md file at the root of Github repo.

I believe it is:

.github/github.css

but that doesn't seem to do anything to the markdown. Does anyone know if this is incorrect?


回答1:


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.



来源:https://stackoverflow.com/questions/51956361/custom-css-file-for-readme-md-in-a-github-repo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!