如何更改html/rmarkDown中内容表中的字体颜色OD?

发布于 2025-02-09 10:57:19 字数 148 浏览 1 评论 0原文

当我指定这样的代码时,内容表中的字体以html中的红色给出。那么,如何更改字体颜色?

output:
  html_document:
    toc: true
    toc_depth: 2
    theme: united

When I specify the code like this, the fonts in the table of content is given in red in HTML. So, how can I change the font colour?

output:
  html_document:
    toc: true
    toc_depth: 2
    theme: united

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别低头,皇冠会掉 2025-02-16 10:57:19

您可以在rmarkDown文件中添加CSS块:

```{css}

#TOC {
    color: blue;
}

#TOC a:link {
  color: green;
}

/* visited link */
#TOC a:visited {
  color: cyan;
}

/* mouse over link */
#TOC a:hover {
  color: hotpink;
}

/* selected link */
#TOC a:active {
  color: blue;
}


```

内容表的div称为#toc,并且可以直接更改属性。

you can add a css chunk in your rmarkdown-file:

```{css}

#TOC {
    color: blue;
}

#TOC a:link {
  color: green;
}

/* visited link */
#TOC a:visited {
  color: cyan;
}

/* mouse over link */
#TOC a:hover {
  color: hotpink;
}

/* selected link */
#TOC a:active {
  color: blue;
}


```

The div for the table of content is called #TOC and it is possible to directly change the properties.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文