使用 CSS 为 Xaringan 中的第一张幻灯片添加边框
Add border to the first slide in Xaringan with CSS
我想在第一张 xaringan 幻灯片中加入红色边框:
这是我的 Rmd 代码:
---
title: "Presentation Ninja"
subtitle: "⚔<br/>with xaringan"
author: "Yihui Xie"
institute: "RStudio, PBC"
date: "2016/12/12 (updated: `r Sys.Date()`)"
output:
xaringan::moon_reader:
css: ['presentation_1.css']
lib_dir: libs
nature:
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
---
# First Slide
---
# Second Slide
---
# Third Slide
---
# Fourth Slide
---
在 css 文件中我做了:
.remark-slides-area div:first-child {
border: 5px solid red;
}
为什么它不起作用?
如果您将标题幻灯片视为第一张幻灯片,则:
.title-slide {
border: 5px red solid;
}
或者,如果第一张幻灯片不是标题:
.remark-slide-container:first-child .remark-slide-content {
border: 5px red solid;
}
你也可以尝试这个接近你的尝试:
.remark-slides-area > div:first-child {
border: 5px solid red
}
我想在第一张 xaringan 幻灯片中加入红色边框:
这是我的 Rmd 代码:
---
title: "Presentation Ninja"
subtitle: "⚔<br/>with xaringan"
author: "Yihui Xie"
institute: "RStudio, PBC"
date: "2016/12/12 (updated: `r Sys.Date()`)"
output:
xaringan::moon_reader:
css: ['presentation_1.css']
lib_dir: libs
nature:
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
---
# First Slide
---
# Second Slide
---
# Third Slide
---
# Fourth Slide
---
在 css 文件中我做了:
.remark-slides-area div:first-child {
border: 5px solid red;
}
为什么它不起作用?
如果您将标题幻灯片视为第一张幻灯片,则:
.title-slide {
border: 5px red solid;
}
或者,如果第一张幻灯片不是标题:
.remark-slide-container:first-child .remark-slide-content {
border: 5px red solid;
}
你也可以尝试这个接近你的尝试:
.remark-slides-area > div:first-child {
border: 5px solid red
}