gpt4 book ai didi

xaringan - 我可以使用 css 将 Logo 添加到 xaringan 模板的每张幻灯片吗?

转载 作者:行者123 更新时间:2023-12-02 03:22:06 24 4
gpt4 key购买 nike

我想调整提供的 .css 文件 here在除标题、反面和最后一张幻灯片之外的每张幻灯片的右上角添加一个小 Logo 。理想情况下,我可以只向 .css 文件添加一些简单的内容,而不是手动对演示文稿的每张幻灯片进行编码。

我尝试添加这个

background-image: url(https://github.com/jvcasillas/ru_xaringan/raw/master/img/logo/ru_shield.png);
background-position: 9% 15%;
background-size: 55px;

.remark-slide-content {
padding-left: 100px; /* delete this for 4:3 aspect ratio */
}

获取

.remark-slide-content {
background-image: url(https://github.com/jvcasillas/ru_xaringan/raw/master/img/logo/ru_shield.png);
background-position: 9% 15%;
background-size: 55px;
padding-left: 100px; /* delete this for 4:3 aspect ratio */
}

图像显示在所有幻灯片上,包括标题和过渡。它甚至会覆盖 .title-slide 图像。

最佳答案

您可以执行以下操作来排除title-slide:

.remark-slide-content:not(.title-slide){
background-image: url(https://github.com/jvcasillas/ru_xaringan/raw/master/img/logo/ru_shield.png);
background-position: 9% 15%;
background-size: 55px;
padding-left: 100px; /* delete this for 4:3 aspect ratio */
}

但这样做的缺点是,如果您在其他幻灯片中有背景图像,它将覆盖上面的图像。所以你可能想定义另一个类,例如也排除:

.remark-slide-content:not(.exclude){
background-image: url(https://github.com/jvcasillas/ru_xaringan/raw/master/img/logo/ru_shield.png);
background-position: 9% 15%;
background-size: 55px;
padding-left: 100px; /* delete this for 4:3 aspect ratio */
}

.logopos {
position: absolute;
top: 9%;
left: 15%;
}

对于您对另一个背景图像有问题的相应幻灯片,请禁用此功能并手动添加它。例如。

class: exclude 
background-image: url("bla")

content

<img class="logopos" src="https://github.com/jvcasillas/ru_xaringan/raw/master/img/logo/ru_shield.png">

关于xaringan - 我可以使用 css 将 Logo 添加到 xaringan 模板的每张幻灯片吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54450769/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com