Markdown Cheat Sheet

# Heading 1

## Heading 2

**Bold Text**

*Italic Text*

[Link](url)

![Image](url)

- List Item

1. Numbered Item

```code block```

HTML Cheat Sheet

<h1>Heading 1</h1>

<h2>Heading 2</h2>

<strong>Bold Text</strong>

<em>Italic Text</em>

<a href="url">Link</a>

<img src="url" alt="Image">

<ul><li>List Item</li></ul>

<ol><li>Numbered Item</li></ol>

<pre><code>code block</code></pre>

Markdown Guide

Introduction to Markdown

Markdown is a lightweight markup language that allows you to write formatted content using plain text. It's designed to be easy to read and write, making it perfect for creating documentation, README files, and blog posts. The syntax is intuitive and focuses on content rather than formatting.

Basic Text Formatting

To emphasize text in Markdown, you have several options:

  • For bold text, surround your words with double asterisks: **bold text**
  • For italic text, use single asterisks: *italic text*
  • For text that is both bold and italic, use three asterisks: ***bold and italic***

You can also use underscores instead of asterisks: _italic_ and __bold__.

Headers

Headers are created using the hash symbol (#). The number of hashes indicates the header level:

# Heading 1 (Largest)
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6 (Smallest)

Use headers to organize your content hierarchically. It's good practice to have only one H1 (#) per document, typically at the top.

Lists

Markdown supports both unordered (bullet) and ordered (numbered) lists:

For unordered lists, start each line with either *, -, or +:

* First item
* Second item
* Third item

For ordered lists, use numbers:

1. First step
2. Second step
3. Third step

You can create nested lists by indenting with spaces:

* Main item
    * Sub-item
    * Another sub-item
* Next main item

Links and Images

Creating links is straightforward:

[Link text](https://www.example.com)

You can also add titles that appear on hover:

[Link text](https://www.example.com "Hover text")

Images work similarly, just add an exclamation mark at the start:

![Alt text](image-url.jpg "Optional title")

Code Blocks

For inline code, use single backticks: `code`

For code blocks, use triple backticks or indent with 4 spaces:

```
function example() {
    return "Hello, World!";
}
```

You can also specify the programming language for syntax highlighting:

```javascript
function example() {
    return "Hello, World!";
}
```

Blockquotes

Create blockquotes using the > symbol:

> This is a blockquote
> It can span multiple lines
> 
> And can contain **formatted** text

Blockquotes can be nested:

> Main quote
>> Nested quote
>>> Deeper nested quote

Tables

Create tables using pipes and hyphens:

| Header 1 | Header 2 |
|----------|-----------|
| Cell 1   | Cell 2   |
| Cell 3   | Cell 4   |

You can align columns using colons in the separator line:

| Left | Center | Right |
|:-----|:------:|------:|
| Left | Center | Right |

Advanced Tips

  • Use backslash (\) to escape Markdown characters: \*not italic\*
  • Create horizontal rules with three hyphens, asterisks, or underscores: ---
  • Use HTML when you need more complex formatting
  • Keep your Markdown clean and consistent for better readability
  • Preview your Markdown as you write to ensure proper formatting