How do I format code in my posts?


#1

Codecademy Discuss posts are parsed with Markdown. Markdown allows for easy formatting of code and text, and strips HTML out of posts by default to prevent security risks. This will show you how to format your code so it shows up.

Summary

To format code so it’s visible, either wrap it in single backticks (``` ``) for a small amount of code, or triple backticks on an otherwise blank line before and after for a large amount of code.

Details

Inline code

To indicate a small span of code, wrap it in backticks (`). For example:

How do I use the `console.log()` function?

would produce:

How do I use the console.log() function?

Code Blocks

To indicate a code block, either wrap the entire block in three backticks:

```
<!DOCTYPE html>
<html>
  <head>
    <!-- metadata and external resources-->
  </head>
  
  <body>
    <!-- page content -->
  </body>
</html>
```

Or, (2) you can indent the code with four (4) spaces:

    <!DOCTYPE html>
    <html>
      <head>
        <!-- metadata and external resources-->
      </head>
      
      <body>
        <!-- page content -->
      </body>
    </html>

The first produces:

<!DOCTYPE html>
<html>
  <head>
    <!-- metadata and external resources-->
  </head>
  
  <body>
    <!-- page content -->
  </body>
</html>

The second produces:

<!DOCTYPE html>
<html>
  <head>
    <!-- metadata and external resources-->
  </head>
  
  <body>
    <!-- page content -->
  </body>
</html>

For more information on Markdown Formatting, visit daringfireball.net.


11. Adding images. What is going on?
What's the problem wit this code?
Adding image problem
Modifying member variables gives an odd error
I need Help
19/19 Stuck
My image tag is not showing up?
HTML Basics ll 11/16 I don't get the Error: Oops, try again. Did you remember to set the font-family to Arial?
8. naming your table
Learn HTML & CSS Part 1, Step 1
Previous slide 2 - cannot get past, please help!
7. You deserved It
Can you help me generlation exercize 5
23. Pseudo Selectors (again...)
Adding images
Stuck- id's
Since 11/13 I lost Run function
Censor
I got to step 5 and when i try to submit my answer the page stops responding
<!DOCTYPE> Still Doesn't Work
Question 13 (IMAGE AND LINKS
Making a purchase
It's Better with a header
It can't see my <!doctype> tag
MOVE (supporting - how to get text to go inline)
Blank space in The Innovation Cloud Project
<p> tags
11/13 code wrong?!
Show a tag 5/9
Here is my code:
Isn't there a mistake in the Code Acadamy example in the Link 'em up page?
Background color is changed but it still gives the error
HTML Basics lll 9. Styles that Head error
Font size color. error mesage did you change your heading to green?
A Day at the Supermarket 12 & 13 (lets me pass but prints nothing!)
6. What if choice one is rock? I cant get my code to work, help?
[solved]12. background color
Check yourself won't work
5.Link it up oops did you remember to link your....why won't it let me continue
23 psuedo selector
What am i doing wrong
The o Shortcut
HTLM basic II 8 Front Size
4. Listing everybody
11.adding image
11.adding image
Problem with 26 links and decoration exercise
Third link is not hovering?
Images
Image et lien
Image et lien
Nav section
Image et lien
#2 Taking up Space display: block; bug?
Trying to figure out how to make code in this QA look correctly formatted
CSS Overview Assignment - Glitch?
Help on taking a vacation 3
Help! I changed fon to Arial but the lesson won't recognize
11. Adding images. What is going on?
Practice makes perfect
Review/23 Pseudo selectors isn't working
Balise paragraphe
Balise paragraphe
PHP server not responding in lesson 11 (portuguese vesion)
Validation not possible
párrafo es 16px en vez de 44px
Class selectors
6: No ID, no entry
6: No ID, no entry
4/7 Stuck
4/7 Stuck
4/7 Stuck
Taking a vacation getting there
Javascript conclusion pt 2 trouble
Add font family for the property selector hero
2 Nav!
Can't save and send the code - unit 4
CSS A font of knowledge
Nothing is showing up in my preview box
"It's better with a header" Stuck
Need Help on Lesson 13 "Putting it all Together"
Uncaught ReferenceError: $ is not defined
19. Create your own code. What is wrong?
Nothing is showing up in my preview box
What is wrong with this code, I keep getting a message saying <li>'s font-size is 16px instead of 12px
3 Your first "for" loop, I'm receving an error I have not seen before and don't know what to do
Oups, merci de réessayer. Avez-vous bien attribué la police Courier à l'id #serieux?
HTML&CSS Basics UNIT 1- Less. 1, #11 Less.2, #2 WILL NOT accept correct answer
What's wrong with this code?
The issue is the same: here is the code
3. One selector to rule them all
Impossible. Building with bootstrap>part six>step 2
Need help with exercise 2
Why is this code not working? (ep. 8 related but my changes are the problem)
CSS Selectors: Show it if you know it
Is prime
14 Span is the Man
Link it up
HELP! 8 Font color
HELP! 8 Font color
Confusion on The Second For Loop
Help cannot get passed font size!
Lesson one on building a website
Lesson 8 front size
Code puzzle
I can not see what is wrong
I don't see the problem with desing a button
Error message incorrect?
9. font-color
Font Size
The BIG IF
Totally Lost on While Loops Variables
9. font-color
Question about 8. Design a Button for your Website
6.5 "Did you add the link to the destination?"
Adding Images. The code won't submit even after putting space between .jpg and />
Exercice 7 tableau html debutant
Is prime
16/18
7. What if choice 1 is paper? - Unexpected token else
Whats is wrong in my code?
Exercise 4/6
How do you pass the font-size and family code?
Why is this code wrong
Bonsai
HTML/CSS lesson 9: is there a bug?
'Div'ide and Conquer
Exercise 7 where do I add the quotes
Don't understand what is wrong with my code?
Not sure what I am doing wrong? (Link me)
Code is not working
Build a resume!
Oops, try again. Make sure your <span> tags only contains 'Impact' and nothing else!
Transportation Issue
Stuck on 13. Make sure at least one of your images is also a link
Looks like font size is 32 not 16. What am I missing?
Need help!
And or Or
26. Links and Text Decoration
Html / css questão 16
FONT FAMILY I need help?
Help!
Lesson 26
#3 one sector to rule them all
"Your second <li's> font is 16px instead of 12px"
Stylizing heading and font-family colour
If,else and elseif - ARGH why doesn't my code work?
15.15 Median
HTML II Basics: Font color Why isn't my header green?
Hello there!
Hello there!
Exercise 5. I can't find the mistake, can someone help me? D:
12. ID please CSS Selectors
How do I fix the code? It is not specific!
8: One Selector, Many Properties. Error with Garamond font
Hello there!
5/7 Second For isn't Pushing Values to the Array
Problema en selectores de CSS capitulo 8
CSS: un vistazo general ¡Enlazalo!
Unable to add space on top of my footer
Stuck on 25
HTML Basic 2 chapter 8
Build your own webpage #2
10. font family
Help
Own Code 13/13 please check what I did wrong?
Lesson 15.Links
Oops, try again. Add a <div class="col-md-4">..</div> in the <div class="row">..</div>
What's wrong with console.log?
23 Many selectors, many properties
Struggles
Oops, try again. Did you give your third paragraph a font-size of 26px? It looks like it's currently undefined
Lesson 3
18. need help
q3 on section 2 html basics
Keep getting Unexpected token error
I'm having trouble with the adding images exercise
Changing font family
17 review functions codecademy
Introduction HTML III basics
What's wrong here?
Background image of the .main
11...The picture showed up on the right...why can't I proceed?
Exercice pierre, feuille, ciseaux
Build a Calculator! -- Make sure the button has the exact id 'button'
HTML video element 8/13
CodeAcademy - Ruby - Putting the Form In The Formatter - Repeat for more input
Please correct my code
Adding image problem
3- inline-block (CSS Positioning)
Part of the Whole and Error: Make sure you define get_class_average
Final Product
Search for a freind
Need help on "Previous Slide 1" (ex. 8)
AngularJS Instructions Step 4
Formatting a topic
How Is Everybody Doing?
I don't understand "add a new line below your code to move your p tag after the div with id #one"
Singup 1 part 4
Need help in excercise 3rd
30.What are objects for?
Exercise 6, why does it tell me to make sure I'm adding the "active" class on hover?
3. Adding some story + TypeError: console.log is not a function
The Do's and Don'ts of Codecademy
General question re using jing in forum
Python Date and Time Grand Finale
LESSON 25 size and borders , 26 links and text decoration
Build a resume!
Your second 'for' loop isn't pushing values to the hits array
Need help on booleans on javascript
Need code for all 3 ideas in 9)Next Steps of Build "rock,paper and scissors"
Hey having a problem with the introductory course 8/12
Where to place <table> tags?
25. stuck
What is wrong with my code for 12. Or
Exercise 8
Intro to Functions, Lesson 4 - right and wrong at the same time
Java Methods II error
17/19 A REAL WIN- please help
More on Control Flow in Javascript
Don't work?
2.cant find the problem
The Big If
Wont let me pass
14. The color will not show up
Iterating over a list in a function interesting error
Help with addition of variables
Introduction to while loops in JS 10/11
Question on lesson 11. Function recap
Problems with My Constructor Function
4/7 If statement
2.Old enough to play
I'm confused
Code not working
I need help with #12 on java!
5. logical operators - ERROR
Calling the function -- https://www.codecademy.com/courses/functions_in_javascript/0/1
Syntax error: unexpected token else
Search Text Your Name .! Not getting hits
15/15 median
Little doubt
8. What if choice1 is scissors? PROMPT ERROR?!?
Syntax Error?
Syntax Problems | Number 12
Question 8
Can someone spot the errors in my code? :)
What if Choice 1 is scissors? Having some trouble
Code not working on a real server
17/19 A Real Win
HTML Basics II 8 (Font Size) 'It looks like 16px'
10 You win
Code correct but same error mssg wont go away - help!
Making a Surface Area and Volume calculator
What is the HTML Tag Really?
Problems with 4/6.redacted
Previous dot 2
Build a resume: overlapping header
Adding js and jquerry to a file
[FAQ] Common Problems #Read Me
Adding images
Lesson 5 A picture is worth a thousand words
Modifying html element
My code doesn't work on exercise 5
Problem
6. is_prime
Plan Your Trip
Stuck at exercise "4.Transportation". Code seems correct
11/18 list manipulations in functions
Yoohoo! can anyone help me! something is wrong with my code!
Help
6. Just weight and see
The history heats up!--Cant find error
7.reverse help
Oops, try again. Does your code print "empty" when len(original) is 0?
is_prime
Why do I need tags?
Oops!try again your function returns true for 3
"Practice Makes Perfect"
Inheritance
Everything
Logo and Nav in one line
Lesson 15 - Oops, try again. Make sure you put some text between your <a></a> tags!
Feedback... Again (Sorry)
8. What if choice1 is scissors? SyntaxError: Unexpected token else
Please help! I am having a problem with font size at this particular screen
Need help #10-previous dot 1
Rails authentication - step 11/12
7.What if choice1 is paper?
Code wont work on sublime text
Whats wrong with my code?
Whats wrong with my code?
5. What am i doing wrong?
I can't figure out exercise 5 step 1
6.Just Weight and See
The Big If
Dynamic Time Warping from Excel Workbooks
Image tag
13. Not Again
Printing numLegs of emperor
8. Part of Whole
12 Stocking out
Why doesn't this code work if x = 9?
No me acepta el font-family necesito ayuda
Codeacademy Python 4/11 MadLibs
Oops, try again. Did you remember to change the first <li> to the font Arial?
Hi all (TRY TO UNLOCK my 4 digits code)
Why does it tell me I'm not setting the div's opacity to 1?
Sending a Letter problem
6. Just Weight and See
Text-Alignment in Ordered/Unordered Lists
Starting my portfolio with a resume made with my HTML and CSS knowledge
23.Pseudo selectors. whats wrong?
How is everybody doing! Moderators Help pLease!
HTML BASICS ll
"Review: Built-In Functions"
Adding images to your website
Can someone please show me how to nest the tags to change the font size?
Could someone help me with the font size lesson? (exercise 8)
6.5 Error: “Did you add the link to the destination?”
15. The Big If
Help?
Jquery 4 Moving element Around
Clickable Photo Page course: Unable to display images
Cannot pass lesson 2!
Im realy stuck! it says i havnt put in my <!DOCTYPE> what do i do!
What if choice1 is scissors?
<!DOCTYPE> Still Doesn't Work
Something of Value (10 - 9) Confused with output
Background color
Functions, Part I: Functions Explained
8. Part of the Whole
What am I missing?
10 - Censor / 15. Practice Makes Perfect
Did you change the value of title to your own String?
Empty p tags
CSS Borders
What did i do wrong in my CSS?
Adding <em> and font-size and font-family
Background Color
Image and Links Help Please
5 Link it up
1. We've come a long, long
Pulling it Together
Can't pass adding image lesson 11
HTML & CSS Social Networking Profile- 5. Lists within lists
Code not getting submitted
17/18
10/11
Can anyone tell me what im doing wrong with <p></p> it keeps telling me no empty p tags
What does it mean if I get the error code 'Invalid left-hand side in assignment'
7. Search for a Friend - Don't understand
23. Pseudo Selectors
8.Part of the Whole
I can't add image to .html file in TextEdit on my computer
Having problem at level 10 font family
Lesson Number One
Sending a letter
Need help in project
Why doesn't the cost show up in the console?
Python Password Generator
Bad aim
#17: review function
Stuck on "Build rock, paper, scissors"
Help w/ Practice makes perfect 6/15
Stuck on Lesson 26 "CSS: An Overview"
CSS: An Overview Many Selectors, Many Properties
CSS: An Overview Many Selectors, Many Properties
Code your own adventure. Part #5
15, Play it Sam
List manipulation in functions: Help please
1/14 Create New Variable
Site not letting me move on even though code is correct -- and where do I post my question?!?
Is list declaration necessary?
Lesson 10 confusion with the href
It doesn't work i dont know why
12. Printing out a list item by item in a function "list index out of range"
[Python]Student Becomes the Teacher 8. Part of the Whole
18. Using a list of lists in a function
[Python]Student Becomes the Teacher 8. Part of the Whole
Own python project issues!
Answer to 9/9
Cannot return Steve
19 math javascript
Purify
Does your code take one argument?
Help on "hey, you never know"
11. Making a Purchase
An exception was raised for fizz_count
16 Using Strings in lists in functions
Step 6: I am having problem with my code, please assist. Thankyou
Functions, what is it really used for and am stuck
Transportation problem
Error
I don't know what is wrong
12. Stocking Out, need help
IndentationError: unexpected indent
14/18 Passing a range into a function
Practise makes perfect
[solved]Review functions
I need help in DATE AND TIME "GRAND FINALE"
Lets take a vacation: your
Reverse
How to copy 4and paste the code
I pass but when I click on the images they don't do anything lesson 13
To show an image
Part of the Whole Error
Div styles
Game over help
Game over help
6. solo flight
Unexpected indent, help needed
Calendar project
Need help with Social Networking Profile
Guys help im really stuck with html and css part 1 lesson 3 6/6
Why got this error
Functions & if / else
I have a problem with setting the text-decoration to none
Python if/elif/else
Whats wrong with my code?
Rock, paper scissors
Html and css understanding
6. is_prime
Can't continue
Taking a vacation pulling it together
8. modifying member variables still stuck on this class stuff?
Need help with linking at will
Return statement throwing error
Built in functions (19)- stuck
From .... import .... syntax error
Last part- how is everybody doing
Review
Test Run
Python
15. Iterating over a list in a function
How to center a nav bar
Battleship
Battleship
19. Review: Built-In Functions Pls Help!
19. review: built-in functions
Help with 4/7
Could someone please tell me what is wrong with my code?
What is wrong in this code?
Initializing a class
Python
Please help me correct the error in my code. I keep on getting "uncaught syntaxerror: illegal return statement
Python Censor Activity
Lesson 1. where can i know "my name"?
Code not working plz help
Loop incremental
Indentation error:
Part of Code
Review: Functions
Problem with exercise - Nested Elements
Scrabble score:
Python trial #1 - fails after input
Student Becomes The Teacher 9/9 - Please Assist
Remove_duplicates practice makes perfect 14/15
How do I modify console with a parameter in place?
8. What if choice1 is scissors?
Censor
Purify()
They're Multiplying!
They're Multiplying!
Inheritance
Why is 'gold' wrong please help. Says syntax error
Help with these while loops and for loops
Hide
Python | Command Line Calendar. Indentation Error
Review: Built in functions
Inheritane syntax
URGENT HELP on calculator code pyhton
Html question over here
Meal Maker Mess Ups
Problem with whitespace lesson? wont let me advance
Html and css nav bar
Lesson 5/13
Could somebody tell me what is wrong with code?
Create a JSX <article></article> element. Save it in a variable named myArticle
SleepDebt Calculator/ JavaScript functions
Part of the Whole 8/9 with formatting
Python tutorial help
Python tutorial help
List manipulation in functions (11/18)
Stocking out: Is this correct?
Using.map
PLS help with my simple asssignment, a guessing game in python
PLS help with my simple asssignment, a guessing game in python
12. Bad Aim
Elements and Structure 15/17: Videos
Please help me finish this html and php code
What is the use of the div tag in this case?
FAQ & Troubleshooting [JavaScript]
Help with the course
Css is not linking to html
Html and css, Sorting your friends. Says pass but result not satisfactory
Review:Function
What's wrong witht his code?
Wont let me succeed 13. Images and links
#2

Whats wrong in this?
I am facing difficulties to go ahead coding
Final Errors