html - GitHub 风格的 Markdown:更改代码块的背景颜色
问题描述
我正在使用 GitHub Pages 制作一个网站,并希望显示具有白色背景的输出代码,而不是代码元素的默认灰色背景(但保留等宽字体)。
在我的index.md文件中,我尝试添加一个内联 HTML 块来处理这个问题,因为 GitHub 风格的 Markdown 不允许您更改代码元素的背景。我使用了以下代码:
<pre><span style="display:block; background-color:white"><code>## Constructed an OTU table and other variables with the following settings:
## thresh_prevalence: 80
## thresh_abundance: 0.5
## thresh_NA: 5
## subj: subject_1
</code></span></pre>
但是输出没有白色背景。相反,它具有默认背景颜色:
在 GitHub 风格的 Markdown 版本中,样式似乎没有列入白名单。有没有办法在没有样式标签或完全没有 HTML 的情况下更改代码块的背景颜色?
解决方案
推荐阅读
- python-3.x - 带有 apache 身份验证的 REST-API python 请求
- python - 无法加载动态库“cudart64_110.dll”;dlerror: 未找到 cudart64_110.dll
- python - 用于成对比较的弗里德曼检验统计量产生 NaN
- python - 对元组中的最后一个元素求和,其中元组中的前一个元素匹配
- javascript - 我的 if 语句没有做它想做的事
- java - 如何在实体之间创建 JPA 规范连接
- flutter - Flutter:架构 arm64 的未定义符号
- javascript - 没有选项进入动态填充的选择标签
- javascript - PostgreSQL:从 CSV 文件读取数据时出现 INSERT 错误
- performance - 如果来源太多,预连接来源的顺序是否重要