On the right most side :slight_smile: Screenshot with iA Writer for comparison:

Using

.CodeMirror-code {
	max-width: 700px;
}

currently is good enough for me.

Thanks for nudging me into the right direction, @rsdimitrov!

1 Like

Thanks! I was wondering if others are getting the tags popup (suggestions after you type in #) to appear way off to the side? Not a big deal but wondering if that is normal or if I’m misimplementing something!

Sorry I am completely new in this world of changing the CSS . I also find same issue as you with the scrollbar, I would like it to be in the right. So, what should I add at the end of the CSS file, this?:

.markdown-source-view, .markdown-preview-view {
max-width: 700px;
margin: auto;
}
.CodeMirror-code {
max-width: 700px;
}

Just the latter. Be aware that this only limits the width, but does not center the text form; the text itself remains left-aligned using this method.

Perfect! Thank you very much, I will try it out

.markdown-source-view, .markdown-preview-view works for me but with the scrollbar.
CodeMirror-code does not work to centralise the content. Not sure why??

To all asking about the scroll bar: I’m unsure how to fix this for y’all. I personally hide the scrollbar because I find it unnecessary. Maybe trying finding a smaller

than the “…-view” divs to adjust.
.CodeMirror-lines, .markdown-preview-view{
   max-width: var(--view-max-width);
   margin: auto; 
}

I found this can move the scrollbar to the edge of editor mode. But I cann’t do anything to the preview mode.

btw: how do you hide the scrollbar. I am newb…

Thanks, folks, for the inspiration to implement this.

This selector chooses only the contents of both source and preview, as far as I can tell:

.CodeMirror-scroll, .markdown-preview-section {
    max-width: 40rem;
    margin: auto;
}
2 Likes

That solved for me.

.CodeMirror-lines, div.markdown-preview-section {
  max-width: 800px;
  margin: auto;
}

FYI this will likely be less of a problem in 0.7!

2 Likes

While selecting the whole page there was a glitch, added ‘selected’ div as well.

.CodeMirror-lines, .CodeMirror-selected,  .markdown-preview-section {
  max-width: 700px;
  margin: auto;
}
2 Likes

Which font are using? It looks really cool!

Whose font? :thinking:

I was responding to the OPs example. In the photo, I liked the font.

I think it’s Lato.

My Font:

Header: Avenir (It’s clean and looks cool)
Body: Open Sans (its easy to read)

A post was split to a new topic: Can Obsidian open multiple edit panes simultaneously?

So this is a nice solution for the preview mode; I can choose the max-width of the text, and the scroll bar is on the far right. However, now, in source view I have two scroll bars which is pretty ugly. Is there any way for edit mode to have this same feature (user specified width, scroll bar on the far right)?

.CodeMirror-scroll, .markdown-preview-section {
    max-width: 40rem;
    margin: auto;
}