Headings are used to define titles and section headings on a webpage.
HTML provides six levels of headings.
<h1>Main Heading</h1>
<h2>Section Heading</h2>
<h3>Subsection Heading</h3>
<h4>Smaller Heading</h4>
<h5>Minor Heading</h5>
<h6>Smallest Heading</h6>H1 - Largest
└─ H2
└─ H3
└─ H4
└─ H5
└─ H6 - Smallest
<h1> per page.<h1>Frontend Development</h1>
<h2>HTML</h2>
<h3>HTML Basics</h3>
<h2>CSS</h2>
<h3>CSS Selectors</h3>Search engines use headings to understand the structure and content of a webpage.
The <p> tag defines a paragraph of text.
<p>
HTML is the standard markup language for creating web pages.
</p>HTML is the standard markup language for creating web pages.
<p>This is paragraph one.</p>
<p>This is paragraph two.</p>The <br> tag inserts a line break.
<p>
Hello<br>
World
</p>Hello
World
<br>
Kathmandu<br>
Nepal
The <hr> tag creates a horizontal line.
<p>Chapter 1</p>
<hr>
<p>Chapter 2</p>Used to indicate a thematic break between sections.
HTML provides two ways to make text appear bold.
Used for stylistic bold text.
<p>This is <b>bold</b> text.</p>Purpose: Visual emphasis only.
Used for important content.
<p>
Please read the <strong>instructions carefully</strong>.
</p>Use
When
<b>
Visual styling only
<strong>
Important content
HTML provides two ways to display italic text.
Used for stylistic italics.
<p>I love <i>web development</i>.</p>Used for emphasized text.
<p>
You <em>must</em> complete this task.
</p>Use <em> when emphasis is intended.
The <pre> tag preserves spaces and line breaks exactly as written.
<pre>
Name: Samir
Age : 21
City: Jhapa
</pre>Name: Samir
Age : 21
City: Jhapa
The <mark> tag highlights text.
<p>
Learn <mark>HTML</mark> first.
</p>The <sub> tag displays text below the normal line.
H<sub>2</sub>OH₂O
CO<sub>2</sub>Output: CO₂
The <sup> tag displays text above the normal line.
x<sup>2</sup>x²
10<sup>3</sup>Output: 10³
The <a> (anchor) tag creates hyperlinks.
Links allow navigation between pages and websites.
<a href="https://google.com">
Visit Google
</a><a
href="https://google.com"
target="_blank"
>
Google
</a>target="_blank"
Opens the link in a new tab.
<a href="mailto:test@example.com">
Email Me
</a><a href="tel:+9779800000000">
Call Us
</a><a
href="resume.pdf"
download
>
Download Resume
</a>Attribute
Purpose
href
Destination URL
target
Where link opens
title
Tooltip text
download
Download file
<a
href="resume.pdf"
download
>
Download Resume
</a>| Tag | Purpose |
|---|---|
| h1-h6 | Headings |
| p | Paragraphs |
| br | Line Break |
| hr | Horizontal Rule |
| b | Bold Styling |
| strong | Important Bold Text |
| i | Italic Styling |
| em | Emphasized Text |
| pre | Preserve Formatting |
| mark | Highlight Text |
| sub | Subscript |
| sup | Superscript |
| a | Hyperlinks |
These tags form the foundation of content presentation in HTML.
<h1>HTML Basics</h1>
<p>HTML structures web content.</p>
<strong>Important Note</strong>
<em>Learn HTML before CSS.</em>
<a href="https://developer.mozilla.org">
Learn More
</a>Mastering these tags will help you create structured, readable, and accessible webpages.