在四开 (reveal.js) 演示文稿中的列之间添加空格

问题描述 投票:0回答:1

我正在创建四开幻灯片并使用两列布局来比较代码段。但是,我想在列之间添加一些空格,特别是对于较长的代码行。作为解决方法,我在中间添加了第三列,但我更喜欢更优雅的 css 解决方案

---
title: "Test"
format: revealjs
---

## Two columns without space

::: {.column width="49%"}
```{r, echo=TRUE}
x <- runif(100)
plot(x)
```
:::

::: {.column width="49%"}
```{r, echo=TRUE}
x <- rnorm(100)
plot(x)
```
:::

## Two columns with space

::: {.column width="44%"}
```{r, echo=TRUE}
x <- runif(100)
plot(x)
```
:::

::: {.column width="10%"}
:::

::: {.column width="44%"}
```{r, echo=TRUE}
x <- rnorm(100)
plot(x)
```
:::

two columns with space

r rstudio quarto reveal.js
1个回答
0
投票

您可以使用额外的 css 类添加空间(技巧是创建列,使两者都不会覆盖 100%):

---
title: "Test"
format: revealjs
---

<style>
.add-space{
padding-right: 11%;
}
</style>


## Two columns without space

::: {.column width="44%" .add-space}
```{r, echo=TRUE}
x <- runif(100)
plot(x)
```
:::

::: {.column width="44%"}
```{r, echo=TRUE}
x <- rnorm(100)
plot(x)
```
:::
© www.soinside.com 2019 - 2024. All rights reserved.