问题描述
我无法验证 .css
文件的名称,该文件将修改 Github 存储库根目录下的 readme.md
文件.
I am having trouble verifying the name of the .css
file that will modifying the readme.md
file at the root of Github repo.
我认为是:
.github/github.css
但这似乎对 Markdown 没有任何影响.有谁知道这是否不正确?
but that doesn't seem to do anything to the Markdown. Does anyone know if this is incorrect?
推荐答案
出于安全原因,GitHub 不允许 CSS 通过 CSS 影响 README.md
文件(就像您可以将 CSS 注入到ReadMe,您可以轻松发起网络钓鱼攻击).这包括通过 引用的样式表和与
一起使用的内联样式.
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>
.
自述文件采用降价语法,因此可以进行一些样式设置,例如通过占位符图像添加颜色,就像在 StackOverflow 上一样.例如,您可以使用以下内容添加红色方块 :
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 with the following:
- ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) `#f03c15`
您还可以使用 diff
、json
、html
、js
和 之类的东西css
影响文本颜色.
You can also make use of things like diff
, json
, html
, js
and css
to affect text colouring.
这篇关于Github 存储库中 readme.md 的自定义 css 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!