Header spacing

Trying to learn the details of obsidian and could use some help.

What I’m trying to do

The picture is an embed ![[note/#]] and I would like to reduce the amount of space between the “v1” and the text.

Things I have tried

I’ve tried custom script from Huge spacing between headers and text but with no success.

Thank you!

These posts might help you figure things out:

https://forum.obsidian.md/t/getting-comfortable-with-obsidian-css

https://forum.obsidian.md/t/meta-post-common-css-hacks

If you don’t get an answer here, there are some extremely kind wizards in the #appearance channel of Obsidian’s Discord server who essentially produce snippets on request.

1 Like

Would you like to reduce that spacing in all the instances of a # heading before a block/paragraph? Or only those within ![[embeds]]?

Also, all headings or only # h1s?

CSS is usually very nit-picky. :man_judge:t4:

EDIT: updated to cover all ![[embedded]] headings.

.markdown-rendered :is(h1, h2, h3, h4, h5, h6) {
    margin-block-end: 0.2em; /* default is 1em */    
}

Thank you!

I must be doing something wrong on my end, the change is not taking. If i understand correctly, I create a .css file, with the code you provided, in css snippets?

Thank you for the help!
Erik

Yeah, the steps are linked below. The .css file can be named anything. Be sure to use a proper code editor to make it (Notepad++, Sublime Text, VSCode, etc).

Keep in mind, this CSS only covers headings in ![[embeds]], not headings in regular text.


For regular text, you could give these custom properties a try:

This is great! Thank you for the help and for your time.

Erik

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