Good job finding the fix!
“I don’t know CSS. But, I wish I did.”
That’s okay - everyone was clueless about CSS at one point, and it’s easier than it looks (actually it’s really fun).
CSS lets you change the color and position of everything you see.
For example, to change the background color of Obsidian’s bottom bar (status bar), you just add:
/* status color */
.status-bar { background-color: black; }
^
/* status color */ is a comment (the computer doesn’t read it. It’s just to help you remember what the code does).
.status-bar is the target element (the item you want to change with CSS).
Everything between { and } is the declaration. This is where you define what you want to change.
Each declaration changes one property. For example:
{font-size: 22px;} changes text size,
{color: red !important;} changes text color (sometimes you have to add !important like that to force the CSS to change).
HOW TO CHANGE CSS:
You can see all the CSS that’s affecting the appearance of Obsidian right now - click “View” in the top menu, then “Show developer tools”. This opens a new window (dev tools).
In the top-left of the new window is a little arrow icon. Click that little arrow and then select something in the Obsidian app.
When you do that, the dev tools window shows the code for the element you selected (in the left pane), and all the declared CSS properties of that element (in the right pane).
You can play around in dev tools by clicking different elements to learn about CSS.
You can also temporarily change the CSS properties right there in developer tools, to see how changes will look. But these changes are temporary, when you restart Obsidian, they will reset.
To make a permanent CSS change, you have to add your changes to a “snippets.css” document in vault/.obsidian/snippets/snippets.css (you can get to that folder by going to the ‘Appearance’ tab in Obsidian settings, and clicking the little folder icon next to “CSS snippets” at the bottom.
It’s pretty fun to play around with CSS because you can change the appearance of everything in Obsidian.
In your case, the property that was adding space was probably “padding-top”. The element was probably “CodeMirror-lines”.
If so, you would change it with:
/* eliminate all space above text */
.CodeMirror-lines {padding-top: 0px;}
I wrote all this because CSS is a fun way to get into coding, and I see you want to learn.
Play around in the dev tools (you won’t permanently break anything) and you will probably love it
If you have any questions, feel free to ask.