Beginner CSS Questions

Hi everyone!

New to the forum and had a few, probably very basic questions regarding some custom CSS adjustments.

  1. Currently the markdown text color I use to highlight text on a page is the same as the highlighting that occurs when I click on backlinks and the text is found in the main panel. Is there a way to make the highlighted color different between these two uses?

  2. What is the CSS to change the color of text when it gets bolded?

Thanks so much!

So it sounds like in your custom CSS you are just overriding CSS variables? You’ll need to target specific elements to do what you want.

First, I suggest reviewing this post if you haven’t already Getting comfortable with Obsidian CSS

Highlighted text uses the .cm-formatting-highlight class in edit mode and <mark> tag in preview mode.

Bold text uses the .cm-formatting-strong class in edit mode and <strong> tag in preview mode.

1 Like

Edit Never mind! I figured it out. Thanks again!

Thanks so much!

I will need to read through that post in more detail.

I’ve played around with the .cm-formatting-strong class and have been able to change the color of the “**” that surround the text in edit mode, but have not been able to change the color of the actually bolded text itself in edit mode. In preview mode, the strong tag works perfectly.

Is there anyway to get the text in preview mode to actually change color, instead of just the markdown?

Try .cm-strong for the text inside the “**”

1 Like

How can I change the font of any other language except English with css?

That’s an interesting question. I’m not sure you can do that with CSS. AFAIK fonts are global to all text.