Headings

Mikikiv's avatar
Published Aug 6, 2021Updated May 4, 2022
Contribute to Docs

Headings are titles or subtitles that can be used with Markdown. There is a total of 6 different heading options.

To create a heading, add pound symbols # to the front of a word or phrase.

The number of number signs used should correspond to the heading level. For example, to create a heading level three <h3>, use three number signs (e.g., ### My Header).

Syntax

# Heading level 1
## Heading level 2
### Heading level 3
#### Heading level 4
##### Heading level 5
###### Heading level 6

Rendered markdown headings

Alternate Syntax

Alternatively, on the line below the text:

  • Add any number of == characters for heading level 1
  • Add any number or -- characters for heading level 2.
# Heading level 1
## Heading level 2

Best Practices

Markdown applications don’t agree on how to handle a missing space between the number signs (#) and the heading name.

For compatibility, always put a space between the number signs and the heading name.

✅ Do: # Breaking News

🚫 Don’t: #Breaking News

Headings should have a blank line above and below for compatibility and readability:

... text ends here.
# Heading
More text starts here.

Example

# Headings
This page is about headings.
## The cool things about headings
Headings are a great way to format the page.
## Example
Here's an example of headings.

All contributors

Contribute to Docs

Learn Markdown on Codecademy