Xaringan: How do you change code chunk background color?

喜夏-厌秋 提交于 2019-12-13 02:33:29

问题


Is it possible to change the background color--and other attributes--of code chunks? Is there a class associated with code chunks?

Modifying the background color for inline code is simple:

.remark-inline-code{
  background-color: #000000
}

But I am unable to find an equivalent specifically for code chunks.


回答1:


Inspecting the div using Chrome developer tools, you see that the color is set by class .hljs-github .hljs.

Setting

.hljs-github .hljs {
    background: red;
}

should do what you want :)



来源:https://stackoverflow.com/questions/52030224/xaringan-how-do-you-change-code-chunk-background-color

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