首页 > 解决方案 > styles.css 在 markdown 和 bookdown 中的行为不同

问题描述

我使用框和图标来突出我的降价文件中的段落。最近我想将我的单个文件以 bookdown 格式编译为章节。以下内容在独立降价中效果很好:

---
title: "Untitled"
author: "Author"
output: html_document
---

<html>
  <style> 
.infobox {
  padding: 1em 1em 1em 4em;
  margin-bottom: 10px;
  border: 0px solid blue;
  border-radius: 10px;
  background: #f5f5f5 5px center/3em no-repeat;
}

.information {
  background-image: url("question.png");
}

</style>
</html>
      
::: {.infobox .information data-latex="warning"}
Hello World.
:::

在此处输入图像描述

并且在 bookdown 中不起作用。似乎以不同的方式处理图像或路径。有人可以帮忙吗?我很确定它原则上是有效的,因为 yihui 在 bookdown 中使用它:

https://bookdown.org/yihui/blogdown/website-basics.html

我想拥有这么漂亮的仙人掌。

标签: markdownbookdown

解决方案


推荐阅读