Manuel Spínola
Manuel Spínola

Reputation: 79

How do I control the author and date text in the title-slide in xaringan slides rmarkdown with a css file

I want to control the author and date text in xaringan rmarkdown with a css file?

I tried with

.title-slide h3 {
  font-weight: normal;
  font-size: 40px;
  color: grey;
  background-color: white; }

But apparently this control both, the author and date together, but they stay on top of each other (at the same position).

Upvotes: 4

Views: 1119

Answers (1)

Yihui Xie
Yihui Xie

Reputation: 30164

By default, the author is the first h3, and the date is the second h3, so you can use the CSS selector nth-of-type on the title slide, e.g., color the author to red, and date to gray:

.title-slide h3:nth-of-type(1) {
    color: red;
}
.title-slide h3:nth-of-type(2) {
    color: gray;
}

Upvotes: 12

Related Questions