You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Quarto Reveal.js演示文稿中增大Logo尺寸?

调整Quarto Reveal.js演示文稿中Logo的尺寸

你可以通过自定义CSS覆盖默认的Logo样式来调整尺寸,以下是两种简单可行的方法:

方法1:内嵌样式(无需额外文件)

直接在YAML配置中添加自定义CSS代码,修改slide-logo类的尺寸参数:

format: 
  revealjs:
    logo: mylogo.png
    include-in-header:
      - text: |
          <style>
            .reveal .slide-logo {
              height: 100px !important; /* 按需设置高度值 */
              width: auto !important; /* 自动保持宽高比,避免Logo变形 */
            }
          </style>

如果你的Logo更适合按宽度调整,可替换为:

.reveal .slide-logo {
  width: 150px !important;
  height: auto !important;
}

方法2:外部CSS文件

创建一个名为custom.css的文件,写入以下样式:

.reveal .slide-logo {
  height: 100px !important;
  width: auto !important;
}

接着在YAML配置中引用该文件:

format: 
  revealjs:
    logo: mylogo.png
    css: custom.css

补充说明

Reveal.js默认给Logo的.slide-logo类设置了较小的固定尺寸,使用!important可以强制覆盖默认样式,确保自定义尺寸生效。

内容的提问来源于stack exchange,提问作者MartineJ

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.16 03:01:24