Github - how to change font size in markdown file?
Asked Answered
E

5

14

I'm wondering how to change font size in Readme.md file.

`**Zad. 0** <br />`

I want 'Zad. 0' to be bigger, but i have not found any solution yet.

Ethylene answered 8/4, 2023 at 8:44 Comment(1)
Markdown is about not giving you styling in that sense. You get headings (which will be bigger than paragraph text because they're headings) and you get paragraph text, which is all the same size, because all paragraphs are just paragraphs. Can you explain why do you need that text to be bigger? I.e. what is the role of that text in the larger text? (Also, don't put <br> in your markdown, it's not HTML. Use "\" as the end of the line, or use two spaces, but that second one is pretty terrible because code editors will often strip trailing white space).Provided
T
8

Markdown is meant to be translated into HTML (and usually is); most markdown editors do the rendering as you write.

Therefore, you can use HTML tags and inline CSS to customize text appearance, just as you would do in HTML.

<span style="font-size:0.5em;">Text goes here</span>

This would result in text being half the normal size.

Thaddeusthaddus answered 25/1 at 14:29 Comment(2)
It would be good to clarify if you tested this; I've just stumbled across this specifically because style attributes are being totally ignored by github, and thus what vs code renders for the markdown preview is very different from what github is rendering, i.e. <p style="...">...</p> is not working.Unalloyed
The example doesn't render differently in gh. But neither does the <small> that their previous renderer supported it seems. So still looking for an answer to this.Unalloyed
A
2

TL;DR


As other answers have said, you CAN use html tags in markdown, but it's generally kinda frowned upon. With the exception of headers # all font is the same size, but you can format to call attention to more important parts.

The beauty of MD (markdown) is that it is very easy to format without html tags and instead using simple characters.

Ankus answered 26/2 at 17:7 Comment(0)
C
0

You can use hashes to increase the size of text in markdown. For example # README Creates a big title of "README". The more hashes, the smaller the text becomes (## [text] is a subtitle and ### [text] is a smaller subtitle).

Curative answered 8/4, 2023 at 8:49 Comment(1)
sadly # generates a <h..> tag and may not be preferable in an SEO setting.Synn
S
-2

You can use the HTML <h1> to <h6> heading tags in your markdown file to change the size of your font/text.

Selfcommand answered 6/6, 2023 at 2:14 Comment(2)
Apparently you are correct, in that the HTML heading tags are available, but is there a reason to put raw HTML into the Markdown text stream instead of using the Markdown hash method mentioned in other answers?Retina
Is this the only option? These are header blocks and not inline and I don't believe answer the question correctly.Tingley
D
-3

Try writing it in heading format.

use '#' before the text you want to highlight.
You can try writing <# Zad .0> Example text

Demonstration answered 8/4, 2023 at 8:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.