【发布时间】:2021-01-07 06:03:27
【问题描述】:
我正在使用 rmarkdown 编写一个 html 文档。我想将作者(可能还有日期)固定在左下角(在侧边栏中)。
我有点知道我需要以某种方式让这种风格发挥作用
.sidebar-footer{
height: 50px;
position: absolute;
width: 100%;
bottom: 0;
list-style-type: none;
padding-bottom:5.5em;
}
我的 rmd 文件是:
---
title: "project"
author: "Name"
date: "11/12/2020"
output:
html_document:
toc: true
toc_float: true
toc_collapsed: true
toc_depth: 3
theme: lumen
highlight: default
css: www/css/master.css
---
```{css}
tocify.sidebar-footer{
height: 50px;
position: absolute;
width: 100%;
bottom: 0;
list-style-type: none;
padding-bottom:5.5em;
}
```
<div style="sidebar-footer"> hello
</div>
# Level one
```{r}
plot(1:10,2:11)
```
## level two
### level three
# level one a
我的自定义 CSS 是
#TOC{
margin: 0 !important;
height: 100%;
border: none;
padding: 0;
background-color: #f8f8f8;
left: 0;
border-right: 1px solid #e7e7e7}
.tocify{
background-color: #f8f8f8;
border-radius: 0px;
}
.list-group-item{
background-color: #f8f8f8;
}
div.tocify {
width: 20%;
max-width: 260px;
max-height: 100% !important;
}
我对 html 和 css 的工作原理并不太熟悉,因此我将不胜感激。 R具有生成浮动目录等的默认css
【问题讨论】: