We are currently planning to migrate to a different platform for the forum. We will announce this fact both here and on Twitter, once we have settled on a solution.

How to set the background for a fenced code block?

Hello,

How do I set the background for a fenced code block to look something like this?

code block

I tried adding the following custom CSS, but this only highlighted the text, but didn't change the background of the whole block.

.cm-fenced-code {
  background: #E6E6E6;
}

Anybody has a suggestion how to do this?

Thanks in advance,
Peter

Comments

  • This is not possible on a pure CSS basis, some changes are needed to the core, but there's already an issue over at GitHub. Simply stay tuned when this gets closed!

  • body #editor .code-block-line {
      background: #001d35;
    }
    
Sign In or Register to comment.