What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

Possible Duplicate:
How do I format my code blocks?

This newbie cannot figure out how to include code in a question. I'm getting a message saying I need to indent everything, but when I do still can't post. How do I post code and html with my question?

share|improve this question

marked as duplicate by Al E., Yi Jiang, hims056, Toon Krijthe, Some Helpful Commenter Feb 4 '13 at 16:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
How to you indent your code? Could you post your question here? –  Dennis Feb 4 '13 at 14:23
1  
Did you select all the code and then click on the {}icon? Or hit ctrl+k? –  Bart Feb 4 '13 at 14:23
2  
stackoverflow.com/editing-help#code ... that's all there is to it, really. –  Felix Feb 4 '13 at 14:26
    
I'm really thinking we could do better than the "please indent code" notification, seems like we get a question like this once a week... –  Ben Brocka Feb 4 '13 at 14:55

1 Answer 1

Read this http://stackoverflow.com/editing-help#code

To add code you need four spaces added in front of all of your code. An easier way to do this is to highlight all of your code and then hit the button that looks like {}.

Here is some example code

print("Example code")
2 + 2
sqrt(2^2) == 2

You can 'edit' this post to see the actual markdown used to render it to get an idea of how to format the code properly.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged .