Unit 1: H1 To H6
Introduction
Headings and paragraphs are the basic building blocks of any webpage. They help organize content and make it easy to read and understand.
Headings (<h1> to <h6>)
HTML provides 6 levels of headings:
<h1>→ Largest (Main heading)<h2>→ Subheading<h3>→ Smaller heading<h4><h5><h6>→ Smallest
Example:
<h1>Main Heading</h1>
<h2>Sub Heading</h2>
<h3>Section Heading</h3>
<h4>Small Heading</h4>
<h5>Very Small</h5>
<h6>Smallest Heading</h6>
👉 Use <h1> for titles and <h2>–<h6> for sections.
Unit 2: <P> Tag
Paragraph Tag (<p>)
The <p> tag is used to write text in paragraph form.
Example:
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
Each <p> creates a new line automatically.
Unit 3: <P> Tag
Line Break (<br>)
The <br> tag is used to break a line without starting a new paragraph.
Example:
<p>Hello<br>World</p>
Output:
Hello
World
Unit 4: <P> Tag
Horizontal Line (<hr>)
The <hr> tag creates a horizontal line to separate content.
Example:
<p>First Section</p>
<hr>
<p>Second Section</p>
It is useful for dividing sections.
Complete Example
<!DOCTYPE html>
<html>
<head>
<title>Headings & Paragraphs</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is my first paragraph.</p>
<h2>About Me</h2>
<p>I am learning HTML.<br>I enjoy coding.</p>
<hr>
<h3>Thank You</h3>
</body>
</html>