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!
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
Hayden Taylor
5,076 PointsHow to Properly display code in a forum question/answer/comment
I was just wondering how to properly format code so it displays nicely within an Question / Answer / Comment. I notice this issue mostly with html. Keep in mind I already know that if you space the < and > or remove them the code will display but... it displays as a paragraph not keeping the structure which makes it hard to read....
SO
Am I missing something here?
2 Answers
Mike Baxter
4,442 PointsAt the bottom of where you can comment is a Markdown Cheatsheet. From that sheet you'll find you can use three back ticks ` to create a block of code, and then you can specify which type of code (html, JavaScript, etc.). The one I didn't find on there and learned from a Moderator was how to reference someone by name, which uses the @ symbol and then you start typing the person's name as it appears on the forum. Hope this helps!

Hayden Taylor
5,076 PointsThank you
Mike Baxter
4,442 PointsBack tick ` is (usually) above the tab key. It took me a while to find the first time. Maybe you were looking for that.

Jeff Busch
19,287 PointsHi Haden,
Look to the bottom-right of the text field where you enter your Question / Answer / Comment. You will see Markdown Cheatsheet. That will show you what to do (if I understand your question). You can also look here to see an example.
Jeff

Hayden Taylor
5,076 PointsThank you
John Schnettgoecke
2,012 PointsJohn Schnettgoecke
2,012 Pointstest