1

I'm using markdown in my next.js project:

  • I have multiple .md files
  • I've installed: remark, remark-HTML, and gray-matter

Now, I'd like to change the font size of the paragraph/ p-tag. I've seen other StackOverflow posts saying that inline-CSS should work in the .md files, but it doesn't in my case. I've tried something like this:

<p style="font-size: 14px">Lorem ipsum dolor</p>

and

<font size="3"> This is my text number 3</font> 

Any suggestions?

Ives E.
  • 83
  • 7
  • What do you mean by "isn't working?" Is the raw HTML not included in the output, Is the style attribute being ignored or missing from the output? Or something else? – Waylan Jan 07 '22 at 18:35
  • When I add the inline styling the entire paragraph isn't shown. Maybe it's because the content is shown in a component where I'm using dangerouslySetInnerHTML?! But how can I still change the style? – Ives E. Jan 08 '22 at 11:41
  • Does this answer your question? [Custom css file for readme.md in a Github repo](https://stackoverflow.com/questions/51956361/custom-css-file-for-readme-md-in-a-github-repo) – Tms91 Oct 20 '22 at 13:12

1 Answers1

0

I think I found an answer here: "For security reasons, not all Markdown applications support HTML in Markdown documents."

So what I did: Style the content (from .md-file), which is wrapped in a component, by adding styling rules to the component itself, not the .md-file.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Ives E.
  • 83
  • 7