I have seen users use code blocks

Such as this

in many posts, but in the middle of a sentence only on one word. I can't for the life of me figure out how they did it.

Surprisingly, I searched through Meta and couldn't find a similar question. Can anyone point me in the right direction?

  • 6
    Use backticks ` – Pekka supports GoFundMonica Jul 6 '12 at 13:26
  • Wow, this whole time I saw that and had been just using apostrophes. Thank you for pointing out my ignorance. – user14155 Jul 6 '12 at 13:30
  • 1
    See Markdown Help for more info. – James Allardice Jul 6 '12 at 13:30
  • I remember having this same confusion when I was new here. I had never heard of "backticks." – Josh Darnell Jul 6 '12 at 13:37
  • 1
    @jadarnel27 They're particularly cumbersome to use on an iPad. So much so that I often defer posting my comment/answer until I get back to a real keyboard. – Aaron Bertrand Jul 6 '12 at 14:09
  • @AaronBertrand I've never tried, but now that you mention it, that's pretty terrible to do on my Android mobile device too. – Josh Darnell Jul 6 '12 at 15:12
  • Reminder: don't use code spans for emphasis! – Shog9 Jul 6 '12 at 15:14
  • @user14155: Note that it's possible to view the source of existing posts using the edit link. – Matt Jul 6 '12 at 15:36

You can get markdown help without having to come to meta by clicking the ? while editing and then clicking on the advanced help >> link that appears right under it:

enter image description here

You can also click on the edit link of any post that has formatting you wish to emulate, and see how it was done by reviewing the code behind the answer - which will show the markup/markdown used.

In this case you need to surround the string with the "back-tick" character (`) - for better directions see the other answers.

  • +1 for "click on edit". – nhahtdh Jul 6 '12 at 15:24
  • Edited my post to use links/kbd instead of code spans to keep @Shog9 happy. :-) – Aaron Bertrand Jul 6 '12 at 15:27
  • +1 for teaching him how to fish, but you could have also directly answered the question. – JimmyPena Jul 6 '12 at 15:34
  • @JP he had already acknowledged that backticks are the answer in the comments on the question, so I didn't think that required repeating. – Aaron Bertrand Jul 6 '12 at 15:40

Highlight the word and press ctrl+K.


It's called a "grave accent" and on most keyboards I've seen it is located next to the number 1, on the same key as the tilde:

grave accent on keyboard

Just surround the text with the accent mark to format it like a code block:

Hey how do you like this?

It works in comments as well!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .