How to style one document with CSS?

What I’m trying to do

I want to increase the distance between paragraphs, but only for one document, not globally. I know with CSS this can be done with margin-bottom:1em; or padding-bottom:1em.

Things I have tried

I tried snippets but they apply to all documents. I also tried front-matter but did not find out how to make apply CSS code from there.

I searched the forum but I did not understand everything, especially how people applied their CSS.

I googled and asked Copilot but results tell me to apply snnippets or gave me something without telling me to apply it to one specific document.

Thanks for help!

Optional Full-width note (CSS) might be the solution. Investigating this and if I was successful, I will answer myself.

A custom cssclass will work for this. How the CSS is written will depend on what you exactly want to do, but the most basic would be:

.big-para {
    /* rules here */
}

And in the YAML of the note(s) you want to change:

---
cssclasses: big-para
---
1 Like

Yeah, I found that out as well. The trick is cssclasses inside front matter and having one or more snippets using CSS classes from front matter to format notes. Thank you.

(Deleted previous post because I could not edit it anymore.)

Glad it worked out.

Yeah, sorry about the editing thing. Once you are around a bit longer, it will be fine to make multiple edits.

It’s a forum setting for new users. Sometimes nefarious characters post a legit link, for example, but change it to a spam link shortly after.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.