【发布时间】:2017-03-21 18:24:10
【问题描述】:
【问题讨论】:
-
有人可以在这个问题中添加标签#rmdformats吗?
【问题讨论】:
rmdformats作者在这里。
要更改标题和其他元素的默认颜色,您必须提供一个自定义 CSS 文件,该文件重新定义定义颜色的默认 CSS 元素。
如果认为以下 CSS 元素就足够了:
#main .nav-pills > li.active > a,
#main .nav-pills > li.active > a:hover,
#main .nav-pills > li.active > a:focus {
background-color: #22983B;
}
#main .nav-pills > li > a:hover {
background-color: #22983B;
}
h1, h2, h3, h4, h5, h6, legend {
color: #22983B;
}
#nav-top span.glyphicon {
color: #22983B;
}
#table-of-contents header {
color: #22983B;
}
#table-of-contents h2 {
background-color: #22983B;
}
#main a {
background-image: linear-gradient(180deg,#d64a70,#d64a70);
color: #c7254e;
}
a:hover {
color: #3d1308;
}
a:visited {
color: #3d1308;
}
自定义并将其添加到您的Rmd 文件目录中的custom.css 文件中,并在您的序言中添加css: custom.css。
【讨论】:
如果您不想要单独的 .css 文件,您还可以在 Rmd 文件中的样式标签之间添加元素,例如,在块之外,靠近顶部:
<style>
p {
font-size: 16px;
line-height: 24px;
margin: 0px 0px 12px 0px;
}
h1, h2, h3, h4, h5, h6, legend {
font-family: Arial, sans-serif;
font-weight: 700;
color: #9F2042;
}
</style>
【讨论】:
@csmontt
将此添加到 juba 的示例中。 此外,检查针织文档将极大地帮助您了解如何针对特定方面。
#table-of-contents {
color:orange;
background: grey !important;
}
【讨论】:
我遇到了同样的“问题”。在查看了html页面的源代码后,我发现下面的CSS文件中的以下几项就足够了。特别是左上角框背景颜色是用#content h2 {}自定义的。
#sidebar {
background: #5A7B9C;
}
#postamble {
background:#003366;
border-top:solid 10px #5A7B9C;
}
.title {
text-align: center;
color: #003366;
}
.subtitle {
color: #003366;
}
h1, h2, h3, h4, h5, h6, legend {
color: #5A7B9C;
}
#content h2 {
background-color: #003366;
}
【讨论】:
rmdformats 1.0.2 左上角标题的background-color 对我有用的是:#sidebar h2 { ... } 其中#sidebar h2 用sidebar 标识了该部门中的h2身份证。
我有一个同样问题的问题。在这个主题中,readthedown 我想增加页面的宽度,因为我有一个没有使用的巨大的灰色右侧面板。我尝试了类似下面的方法,但它不起作用:
body .main-container {
max-width: 1920px !important;
width: 1920px !important;
}
body {
max-width: 1920px !important;
}
我成功地减小了宽度但没有增加。使用 goole 检查器,页面大小似乎设置为 809.4px !
【讨论】: