Rstudio 0.98.1028 add background image only to title slide

I am trying to create an R presentation (.Rpres) using RStudio 0.98.1028 with a different background image on the header slide and a different background image on the rest of the slides. I can place my own background (foo.png) by creating a css file in it:

body { background-image: url(foo.png); background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-size: 100% 100%; } 

I managed to disable the default color scheme on the title slide and make the color black with this:

 .section .reveal .state-background { background: transparent;} .section .reveal h1, .section .reveal p { color: black; } 

To get foo1.png in the header slide, Other posts ( Adding an image to the slide with slidify ) I saw a suggestion to add this to css:

 .title-slide { background-image: url(foo1.png); } 

Which does not embed foo1.png. However, foo.png remains on all slides (including the title slide). How do I get foo1.png on my title slide?

+5
source share
1 answer

You are 99%. Only one or two more tricks, and you will have it. You might consider adding the following to make sure your slides use a separate css file with something like the following added to the slide of the title.

 Intro ====== author: Clever Name css: css-file.css 

You can then overwrite the background of the title slide by including the <style> </style> tags located at the top of your .Rpres file, in front of your inline slide or in your separate css file.

 <style> /* Your other css */ .section .reveal .state-background { background: url(foo1.png); background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-size: 100% 100%; } </style> 

You are really there. Just change title-slide { /* do stuff */ } to .section .reveal .state-background { /* do stuff */ }

+5
source

Source: https://habr.com/ru/post/1214895/


All Articles