Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

Dave Yankowiak
Dave Yankowiak
9,105 Points

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!