Javatpoint Logo
Javatpoint Logo

Headers in Markdown

Header refers to the heading in markdown. It is similar to the heading tags created in HTML. The markdown can show up to six headings, ranging between large and small. The headings are represented by the Hash / '#' symbol. Hash symbols are always inserted before the text to make it as a heading.

For example,

Output:

Text

It is essential to insert a space after the hash symbol or before the text. Otherwise, it will be considered as text by default.

A single hash represents the heading with the largest font size as compared to the other headings. A double hash represents the heading with a smaller font size than the first one. Similarly, six hash represents a heading with the smallest font size. In such cases, the hash symbol are inserted in series.

Headers are used as headings in creating projects, files, documents, reports, etc. It makes the document attractive. The types of headings with different font size is useful in creating sub-headings, sub-sub headings and so on.

Let's discuss the syntax for the six type of headings.

Heading 1

Syntax

Output:

Headers in Markdown

Heading 2

Syntax

Output:

Headers in Markdown

Heading 3

Syntax

Output:

Headers in Markdown

Heading 4

Syntax

Output:

Headers in Markdown

Heading 5

Syntax

Output:

Headers in Markdown

Heading 6

Syntax

Output:

Headers in Markdown

All the headings together will appear as:

Headers in Markdown

Bold with Heading

Headings are not represented in bold by default in Markdown. We can use the bold command with the heading to make the headings appear as bold.

For example,

Output:

Headers in Markdown

Note: We need to insert the bold syntax (asterisks) after the heading syntax.

If we will use the bold syntax before the heading syntax, the output will only appear as bod, not as a heading. The hash symbol will be considered as text by default.

For example,

Output:

Headers in Markdown

Hence to avoid this, the bold syntax should be used after the heading syntax.

Similarly, we can use italics and other syntax with the headers.

Examples

Let's discuss an example based on headers.

Example 1:

Explain the top three Headers.

Output:

Headers in Markdown
Next TopicImages 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