In a normal line, if you want to format text as code, wrap it with backtick quotes (`).
Code blocks are produced by indenting every line of the block by at least 4 spaces or 1 tab.
Click on the red points to know more. Move through the exercises by using the buttons or the dot menu at the bottom.
Click on the red points to know more. Move through the exercises by using the buttons or by swiping left or right.
To include a literal backtick character within a code span, you can use multiple backticks as the opening and closing delimiters:
``A literal backtick (`).``
Remember, one level of indentation in a code block equals 4 spaces or 1 tab.
CloseA code block continues until it reaches a line that is not indented.
CloseFormat the text "c=a+++++b;" as inline code.
Format the last three lines as a code block.
Play with the concepts you just learned!
For example:
Create a code block with many levels of indentation
Can you format text (like bold and italics) inside a code block?
See the generated HTML. Even if you don't know HTML, try to understand what's happening. Go wild!
Go to the next lesson when you're ready.