Javatpoint Logo
Javatpoint Logo

Code Block in Markdown

Code refers to the code section in a document, which is generally a highlighted part in a special color as compared to the normal text. The appearance of code in any document is different to make it as a special section. Otherwise, it will be difficult for a user to differentiate between the text and the code.

Syntax

The code in Markdown is represented using the three backtick symbols at the starting and the three backticks symbols at the end.

Note: The text should be inserted between the three backtick symbols, but not in the same line. Markdown ignore the text specified on the same line as that of symbols.

For example,

Output:

Code Block in Markdown

Other markdown commands does not work inside the code section. For example, highlight text, bold, italics, etc. The code is already highlighted in Markdown. Hence, a separate command to change the text format is not required.

Examples

Let's discuss two examples based on the code block.

Example 1:

Output:

Code Block in Markdown

Example 2:

Output:

Code Block in Markdown





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA