I just started learning how to use quarto/revealjs to prepare presentations and I was wondering how I can define a .css file to modify the padding between list elements, but only for one list (instead of the complete qmd document).
For example, I know that if I consider the following CSS text
.reveal li {
padding: 25px;
}
save it in a style.css file, and include it in the following qmd document
---
format:
revealjs:
css: style.css
---
## Bullets
Increase padding for the elements of this list
- A
- B
but not for this list
- C
- D
then I can increase the spacing between the list items for the whole document:
However, I would like to modify just one list. Is that possible?

We can create an
extrapadclass, settingmargin-bottomfor each list item except the last. We can add the!importantoverride to ensure that it applies rather than the defaultreveal.jsCSS list rule.Then use the Pandoc fenced div notation to apply this to the relevant list in your qmd file:
Output:
margin-bottomapplies to space between elements in the list, unlikeline-heightwhich would also create space between lines.See also: