7

如何正确地将徽标添加到标题幻灯片的顶部?

经过一些试验和错误,我想出了这个我添加到 css 文件中的内容。

.title-slide.remark-slide-content:before{
  position: absolute;
  content:url(logo.svg);
  height:60px;
}

在此处输入图像描述

这似乎适用于一个标志,它位于右上角。我也想在左上角添加另一个徽标。有一个更好的方法吗?

4

1 回答 1

6

一种方法是使用seal: false一些 div 创建自定义标题幻灯片。

---
title: "Presentation Ninja"
subtitle: "⚔<br/>with xaringan"
author: "Yihui Xie"
date: "2016/12/12"
output:
  xaringan::moon_reader:
    lib_dir: libs
    nature:
      highlightStyle: github
      highlightLines: true 
      countIncrementalSlides: false
    seal: false
---

<div class="my-logo-left"></div>

<div class="my-logo-right"></div> 

# hello

---

CSS

.my-logo-left {
content: "";
    position: absolute;
    top: 15px;
    left:   20px;
    height: 40px;
    width: 120px;
    background-repeat: no-repeat;
    background-size: contain;
    background-image: url(https://www.r-project.org/logo/Rlogo.png);
}

.my-logo-right {
content: "";
    position: absolute;
    top: 15px;
    right:   8px;
    height: 40px;
    width: 120px;
    background-repeat: no-repeat;
    background-size: contain;
    background-image: url(https://www.r-project.org/logo/Rlogo.png);
}
于 2018-04-17T08:55:11.400 回答