Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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).

like image 635
Manuel Spínola Avatar asked Sep 15 '25 11:09

Manuel Spínola


1 Answers

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;
}
like image 79
Yihui Xie Avatar answered Sep 17 '25 04:09

Yihui Xie