Member-only story

Formatting tips

Make Code Blocks (Gray Box Around the Text) in Your Medium Story

For those of us who don’t speak the code language

Elin Melaas

--

What, is it that simple? Photo by Tran Mau Tri Tam ✪ on Unsplash

I’m not a programmer. I’m happy with Medium’s built-in formatting features and glad they’ve done the job for me. However, I like the gray box around the text. Pretty cool, isn't it?

I have learned that they are called code blocks and are used for programming. Since I don’t know anything from that world: Programmers, feel free to arrest me if you feel you need to. I probably deserve it.

I’ve seen the grey code blocks used in Medium stories before. Now I’ve figured out how to do it, so I’m happy to share the procedure.

How to make the gray box around the text / code blocks:

Method #1 — inline

Press backtick (`) and start writing. Literally that easy, at least on my keyboard. I promise!

I’ve seen other sources say three backticks (```), but I only need to press one ` on my keyboard.

One problem: the sentence can’t start with a vowel. But we’ll fix that, right? Start with another letter and remove it later or something.

Method #2 — standalone box

Do you want a gray box like this?

Write something, highlight it, and press:
Ctrl+Alt+6

Is this something you want to try?

--

--

Responses (3)