Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Simon Sporrong
Simon Sporrong
35,097 Points

When i paste my code in the question detail area on the forum it doesn't go with a black background?

I want to ask a question on a course but when i paste my code in to this area where i'm typing right now it doesn't look good with the black background when i preview it. What am I doing wrong?

3 Answers

Are you using markdown to mark it as code in your question? Take a look at the Markdown Cheatsheet that they link to below the comment box. Here is the instruction for code:

Wrap your code with 3 backticks (```) on the line before and after. If you specify the language after the first set of backticks, that'll help us with syntax highlighting.

Hope that helps.

Simon Sporrong
Simon Sporrong
35,097 Points

Thank you for your reply Dave but I tried that but it doesn't do anything for me. It's really annoying that all you guys can do it properly and lousy me can't event copy+paste code :P

nico dev
nico dev
20,364 Points

Don't worry Simon, it's normally difficult the first times you try until you get used to it.

Just in case, this is it:

  1. The backtick is the key that you should have in the top left of your keyboard (under the ESC one).

  2. Then after you you typed it three times, you can type 'css', or 'javascript' or whatever alike.

    1. The type 'enter' and go to the next line, only then start pasting/typing your code.
    2. Once finished typing/pasting, once again, type 'enter', go to the next line, and only then type three times the same backtick we mentioned earlier.

How'd that go now?

Simon Sporrong
Simon Sporrong
35,097 Points

Thank you so much Nico! I finally managed to paste my code :) Your guide was the best, even tough i didn't need to type 'enter'. Those instructions aren't written in the Markdown Cheatsheet so how are we supposed to understand that without having to ask around?

Anyway, thank you so much :) You're a hero!