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

trying to get code formatting working

nav { 
  display: none; 
  width: 100%;
  background: #000;
  margin-left: -20px;
  padding-right: 40px;
} 

5 Answers

got it :)

@shawn denham, you can also do inline code formatting by using backticks. Don't confuse these with apostrophes though! The button is usually in the very upper left corner of the keyboard (mine is below the escape button and is the same button as the tilde ~). Whatever you put between two backticks should become inline code. Like this!

Thanks Chris!

The back ticks were the only thing I could actually get working.

code bracket test

<code> nav { display: none; width: 100%; background: #000; margin-left: -20px; padding-right: 40px; } </code>

fail :(

James Barnett
James Barnett
39,199 Points

Treehouse uses markdown, as such no tags such as <code> will work.

Here's a handy guide to the various ways to format code here on the forum.

Thanks James! not sure where I got the idea that I could wrap it in <code></code> tags

html

<div>
  <p>my paragraph</p>

css

body {
  font-family: Verdana;
  font-size: 2em;
  margin: 10px;
}
James Barnett
James Barnett
39,199 Points

You need a blank between above the backticks to get the syntax highlighting correctly for the CSS.

James Barnett is there a list of supported languages for the syntax highlighting?

awesome! thanks! :+1:

James Barnett, yup! We're using Pygments, so we should support all those languages, but I can't really promise that all of them work. :smiley: