首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >xaringan标题幻灯片中的多幅图像(徽标和背景图像)

xaringan标题幻灯片中的多幅图像(徽标和背景图像)
EN

Stack Overflow用户
提问于 2022-11-25 14:33:37
回答 1查看 28关注 0票数 1

我试图使用一个标志和背景图像在幻灯片上准备的xaringan (rmarkdown)。我还没找到关于怎么做的说明。

到目前为止,我有这个(只有徽标):

代码语言:javascript
复制
---
output:
  xaringan::moon_reader:
    css: ["xaringan-themer.css","mi_estilo.css"]
    lib_dir: libs
    nature:
      titleSlideClass: ["left", "bottom"]
      ratio: '16:9'
      highlightStyle: github
      highlightLines: true
      countIncrementalSlides: false
---

而且,这是在CSS文件中:

代码语言:javascript
复制
/* Add image and change bg color */
.title-slide {
  background-image: url(logo-ean-blanco.png);
  background-position: 11% 15%;
  background-size: 200px;
  padding-left: 100px;  
}

那么,我现在该如何在首页或标题幻灯片上添加背景图片呢?谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-11-25 16:00:38

您可以在background-image css属性中通过逗号分隔url路径来指定两个图像的路径(一个用于徽标,另一个用于背景图像),还可以为用逗号分隔的两个图像指定其他背景属性。看这里想了解更多这方面的情况。

代码语言:javascript
复制
---
title: "xaringan"
author: "None"
output:
  xaringan::moon_reader:
    css: ["xaringan-themer.css","mi_estilo.css"]
    lib_dir: libs
    nature:
      titleSlideClass: ["left", "bottom"]
      ratio: '16:9'
      highlightStyle: github
      highlightLines: true
      countIncrementalSlides: false
---

mi_estilo.css

代码语言:javascript
复制
.title-slide {
  background-image: url(https://placeholder.pics/svg/100),
                    url(https://picsum.photos/id/870/800/600?grayscale);
  background-position: 2% 2%, center;
  background-size: 100px, cover;
}

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74574308

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档