Github存储库中readme.md的自定义CSS文件 [英] Custom css file for readme.md in a Github repo

查看:463
本文介绍了Github存储库中readme.md的自定义CSS文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法验证.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

但这似乎对降价没有任何作用.有人知道这是不正确的吗?

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

推荐答案

出于安全原因,GitHub不允许CSS通过CSS影响README.md文件(就好像您可以将CSS注入自述文件中一样,您也可以轻松启动一个网络钓鱼攻击).这既包括通过<link rel>引用的样式表,也包括与<style>一起使用的内联样式.

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>.

自述文件采用markdown语法,因此可以完成一些样式设置,例如通过占位符图像添加颜色,就像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`

您还可以使用diffjsonhtmljscss之类的东西来影响文本着色.

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

这篇关于Github存储库中readme.md的自定义CSS文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆