我的标题“Utilize Css”的字体大小似乎对保存在同一目录中的 css
样式表中的 font-size
参数没有反应。我已经试验了此 css
样式表中的所有其他参数,它们都按预期更新了报告,但标题选择器的字体大小参数对报告中的标题没有影响。
我正在使用这样的 YAML
header
---
title: "Utilize Css"
author: "Me"
date: "2019-07-15"
output:
html_document:
css: style.css
---
像这样的样式表
.title {
font-size: 14px;
text-align: center;
}
.author, .date {
font-size: 14px;
text-align: center;
}
body {
font-family: Arial;
font-size: 12pt;
}
h1 {
font-size: 14pt;
font-weight: bold
}
如您所见,除标题的字体大小外,所有字体大小均由 css 样式表设置。
如何使用 css
样式表来控制 html
报告中标题的字体大小?
最佳答案
您应该能够在 style.css 文件中使用 h1.title
来控制标题大小。
h1.title {
font-size: 14px;
text-align: center;
}
.author, .date {
font-size: 14px;
text-align: center;
}
body {
font-family: Arial;
font-size: 12pt;
}
h1 {
font-size: 14pt;
font-weight: bold
}
关于css - 标题选择器不响应 Rmarkdown html 报告的 css 中的字体大小规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57046468/