Formatting

By the end of this lesson you'll be able to make text bold , italic , and struck through , drop in inline code and syntax-highlighted code blocks, and shape a document with blockquotes and dividers — the everyday toolkit behind every README, GitHub comment, and docs page.

Part of the free Markdown course at LearnCodingFast — hands-on lessons with examples you run in your browser, plus practice exercises and a quick quiz.

What You'll Learn

💡 Real-World Analogy

Think of Markdown markers like a highlighter set . You don't open a menu to change a font — you wrap the words you care about in a symbol, the way you'd run a highlighter over a sentence. One asterisk on each side is a thin highlight (italic); two is a bold one; two tildes draw a line through it. The key habit: a marker has to hug both ends of the text, like opening and closing a bracket. Forget the closing marker and the renderer just shows the symbol as plain text.

1. Bold, Italic & Bold+Italic

Wrap text in one asterisk or underscore for italic , two for bold , and three for both at once. The marker must touch the text on both sides — **bold** , never ** bold ** .

Source → Rendered

Prefer asterisks ( * ) over underscores ( _ ). Underscores inside words — like my_file_name — can accidentally trigger italics in some renderers. Asterisks never do.

2. Strikethrough & Inline Code

Two tildes on each side ( ~~like this~~ ) draw a line through text — handy for "old price, new price". A single backtick on each side makes inline code : a monospace snippet that won't be treated as Markdown, so symbols inside it stay literal.

Inside code, stars stay literal: a ** b means a to the power b.

Need a literal backtick inside inline code? Wrap with double backticks: use here .

3. Fenced Code Blocks (with highlighting)

For more than a word or two of code, use a fence : three backticks on a line of their own, then your code, then three backticks to close. Write the language name right after the opening fence — RENDERED RESULT

Common language tags: js , python , html , css , bash , json , sql , ts . GitHub, GitLab, and most docs tools recognise dozens more.

4. Blockquotes (and nesting)

Start a line with > to make a blockquote — usually rendered as an indented bar, great for callouts, quotes, or "Note:" boxes. Add a second >> to nest a quote inside a quote. Keep the > on every line you want included.

5. Horizontal Rules & Line Breaks

Three or more --- (or *** or ___ ) on a line by themselves draw a horizontal rule — a full-width divider. Line breaks are sneakier: a single newline is usually ignored . To force a hard break within a paragraph, end the line with two spaces or a backslash ( \ ); leave a fully blank line to start a new paragraph.

The ·· above marks two invisible trailing spaces. Because trailing spaces are easy to miss in review, many people prefer the visible backslash for hard breaks.

Common Errors (and the fix)

Continue this course