How to change color of `inline code block` in css?

Things I have tried

I search internet, this forum and also all .css of minimal theme that I currently use. I didn’t find style name of this code block.

What I’m trying to do

I am trying to change color of text in this block. By default it is red, I want to make it different color.

Thank you in advance

Add a CSS snippet with the following CSS. Change the color value according to your requirements

.cm-s-obsidian .HyperMD-codeblock {
    color: yellow;

If this doesn’t work try adding “!important” after the color value.

Edit: @volkovics I am sorry because the above is not for inline code. However, the following is!

.cm-s-obsidian {
    color: yellow;
1 Like

Very good, thank you very much, but there is problem. It works only in “edit mode”, when I open “preview mode” it doesn’t work.

.markdown-preview-view code{
         color: yellow;

But this will select both inline code as well as code block.


It works fine for me. Thank you for help!

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