Vertical spacing around (framing) the text block

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

Hello,

I’d like the first and last lines framing a block of text between two headings to have spacing (top and bottom): how do I have to code this, please?

I thought the discussion below had solved my problem, but in fact the vertical spacing effected by the “padding” coding only works on the lines inside the text block, but not on the first or last: is this normal?

Thanks in advance for your replies

Things I have tried

Could you maybe post a screenshot of which spacing exactly you mean?

Yes.


I’m not sure that’s entirely possible to do “programmatically” meaning so that it’d always do the desired formatting automatically.

As far as I can tell the padding you want to exist when unfolded is the same attribute that defines the padding between the closed headers. But please someone say otherwise, I’m not sure this is correct.

In the meantime you can go “low-tech” and just add an empty line after and before headings, combined with this snippet:

.cm-s-obsidian .cm-line.HyperMD-header {
    padding-top: unset;
}

that removes the spacing above headers, and then you can add empty lines, e.g.

open

closed

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