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

How to input code into discussion?

does anybody know how to input code without it dissapearing in discussion?

Also you can specify the language of the code you are using as follows.

    ```css
        body {
             color: red;
        }
    ```

So it's a new line, then 4 spaces, then 3 of those tick things followed by the language, then next line 4 spaces again and your code, then next line 4 spaces and those ticks again. So it would look similar to above.

2 Answers

You can't without breaking the space-time continuum ;p

You indent your code with four spaces when you put it in the box to write your post.

So, for example, if I wrote this:

hello world!

Nothing happens. But if I put four spaces in front of 'hello world'...

hello world!

Woo! You can check out the Markdown Cheatsheet in the posting/comment box for some more Markdown tricks.

Here's a post with a few different ways:
https://teamtreehouse.com/forum/how-to-type-code-in-the-forum