我有一个RMarkdown文档,输出的HTML与下面的示例相同。我要在哪里添加内容以将唯一的CSS id或类应用于每个图形输出?
---
title: "RMarkdown"
author: "Me"
date: "Friday, March 27, 2015"
output:
html_document:
theme: null
css: style.css
---
```{r plot1, echo=FALSE, warning=FALSE, message=FALSE}
library(ggplot2)
x <- ggplot(some_r_code)
print(x)
```
```{r plot2, echo=FALSE, warning=FALSE, message=FALSE}
y <- ggplot(some_more_r_code)
print(y)
```
我已经阅读了 http://rmarkdown.rstudio.com/html_document_format.html 的信息页面,这在一定程度上回答了我的问题,但并没有让我彻底理解。我在评论区提出了一个类似的问题,并希望能得到回答。
谢谢!
p
标签中呈现,并且每个图都在这些段落内的img
标签中呈现。因此,您可以使用以下 CSS 访问第一个:p:nth-of-type(1) img { 在这里输入 CSS... }
并使用以下 CSS 访问第二个p:nth-of-type(2) img { 在这里输入 CSS... }
。希望这能帮上忙! - Eugene Brown