Override font size for tags when in the same line as a header

Trying to have a different font size for tags when they’re part of a header line (h1, h2)

Please see below screenshot of a header line with a tag in it, and a normal text line with another tag in it.

2022-11-08 11_21_21-Window

I’d like the header tags to have the same size as normal text tags.

I’ve tried overriding font-size with !important in the CSS selector for tags cm-hashtagwithout success:

font-size: small !important;

If the .cm-hashtag is inside the heading, you could use the child selector to specify “tag inside heading”. I don’t know the actual markup (I know it can be weird in Live Preview), but something like

h1 > .cm-hashtag, 
h2 > .cm-hashtag {

Unfortunately CSS doesn’t provide a way to select headings in general, so you’ll have to specify every level (I only included the first 2).

@CawlinTeffid thanks for the response, your suggestion worked and I edited it as below to make use of the generic header class.

.HyperMD-header > .cm-hashtag {
  font-size: medium !important;
}
1 Like

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