HTML blocks

html
raw
Author

Mine Çetinkaya-Rundel

Published

July 9, 2022

HTML block

Want to embed an iframe on a webpage or a slide deck? Plop the sharing code in a raw html block!

```{=html}
<iframe width="780" height="500" src="https://quarto.org/" title="Quarto Documentation"></iframe>
```

And here is the result!

A few notes on HTML blocks:

  • They’re useful for visually separating out areas where you include raw HTML in an otherwise (primarily) markdown document.
  • They make it easy to programatically access those HTML blocks should you ever need to do so (e.g., with a document parser or using regular expressions).
  • If you’re using the RStudio visual editor, you can insert an HTML block using Insert > Any > HTML Block or accessing the Insert Anything tool with the ⌘ / shortcut.

Using the Insert Anything tool to insert an HTML block. Typing out the letters "ht" brings this option in the tool.

Learn more

Insert anything