New! Explore our Programming Academy and AI Tutor - learn to code from scratch, free to start. Explore Now
Programming› HTML› HTML Headings and Paragraphs

HTML Headings and Paragraphs

🌐 HTML

Learn about heading tags and paragraph tags.

Lesson 3 of 7 Tutorial
0 of 7 completed

Headings and Paragraphs

Headings

HTML provides 6 levels of headings, from <h1> (most important) to <h6> (least important).

<h1>Main Heading</h1>
<h2>Sub Heading</h2>
<h3>Section Heading</h3>
<h4>Minor Heading</h4>

Paragraphs

Use the <p> tag to create paragraphs:

<p>This is a paragraph of text.</p>
<p>This is another paragraph.</p>
💡 Tip

Use only ONE <h1> per page for SEO. Use <h2> for major sections and <h3> for subsections.

Example

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Headings & Paragraphs</title>
</head>
<body>
    <h1>The Solar System</h1>
    <h2>Inner Planets</h2>
    <p>Mercury is the closest planet to the Sun.</p>
    <p>Venus is the hottest planet in our solar system.</p>
    <h2>Outer Planets</h2>
    <p>Jupiter is the largest planet.</p>
</body>
</html>

Lesson Nav

Lesson sections