Markdown headings use to display headings on an HTML page. HTML contains various heading tags from H1,H2,H3,H4,H5,H6 types.

It uses two different syntaxes to create a header tag.

  • Structure enhanced text - setext syntax
  • structure true text - atx syntax

setext header styles syntax

setext syntax contains he

Heading Type Rendered HTML displayed on the browser

Heading one
==========

| ```HTML

Heading one

```| Heading one| | | |

Markdown heading examples

Markdown Generated HTML Browser rendered
# Heading1 <h1>Heading1</h1>

Heading1

## Heading1 <h2>Heading1</h2> ## Heading2
### Heading1 <h3>Heading1</h3> ### Heading2
#### Heading1 <h4>Heading1</h4> ### Heading2
##### Heading1 <h5>Heading1</h5> ### Heading2
###### Heading1 <h6>Heading1</h6> ### Heading2
####### Heading1 <h7>Heading1</h7> ### Heading2

heading

heading1

heading2

heading2

How to display markdown heading HTML text content

Sometimes, Documentation needs to include HTML tags contained in the headings tag.

<div> test content</div>

As per the above, an h3 tag contains a div tag. The HTML content needs to replace with encoding characters in the heading tag with markdown syntax.

### &lt;div&gt; test content &lt;div&gt;