在四开中使用 html

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

我正在尝试使用 Quarto 构建一个简单的网站,我想知道如何在 Quarto 中使用 html。

我想创建一个分为两个相等部分的页面。左侧只有 .gif 元素作为背景。右侧有一个文本,下面有一个按钮,可以用作链接。

我尝试在index.qmd文件中使用以下代码,但它不起作用。

---
title: ""
---
---
format: html
---
<body style="margin: 0; padding: 0; display: flex; height: 100vh;">
<div style="flex: 1; background: url('gif_example.gif') no-repeat center center; background-size: cover;">
</div>
    
<div style="flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;">
<p>To jest napis na prawej stronie</p>
<button>Przycisk</button>
</div>
</body>

我正在使用 Rstudio

html rstudio quarto
1个回答
0
投票

像这样使用它:

---
title: ""
format: html
---

<body style="margin: 0; padding: 0; display: flex; height: 100vh;">
<div style="flex: 1; background: url('gif_example.gif') no-repeat center center; background-size: cover;">
</div>
    
<div style="flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;">
<p>To jest napis na prawej stronie</p>
<button>Przycisk</button>
</div>
</body>
© www.soinside.com 2019 - 2024. All rights reserved.