Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Text Formatting Tags | HTML Course lesson | BraveProgrammer
  1. Courses
  2. /
  3. HTML Course

Lesson 34 of 55

·HTML

Text Formatting Tags

9 min

Course progress62%

What you'll learn

Keep these ideas in mind as you work through the lesson.

4 points
  • Heading hierarchy (`<h1>`‑`<h6>`) and SEO impact
  • Paragraph `<p>` semantics and proper line‑break usage
  • Horizontal rule `<hr>` vs. CSS borders
  • When to use block‑level elements like `<blockquote>` and `<pre>`

Text Formatting Tags

Block‑level headings

<h1>Page Title</h1>
<h2>Section Heading</h2>
<h3>Sub‑section</h3>

Only one <h1> should appear per page; it represents the main topic. Subsequent headings build a logical hierarchy used by browsers, screen readers, and search engines.

Paragraphs and line breaks

<p>This is a paragraph. It automatically has margin before and after.</p>
<p>Another paragraph.</p>
<p>Line break within a paragraph using <br /> tag.</p>

Avoid using <br> for spacing; rely on CSS margins instead.

Horizontal rule

<hr />

Use <hr> to separate thematic sections. For visual lines, use CSS borders for more styling flexibility.

Additional block elements

  • <blockquote> – For quoted text.
  • <pre> – Preserves whitespace and uses a monospace font.
  • <address> – Contact information for the author or site.

Tip: Keep HTML focused on meaning; use CSS for all visual styling (spacing, borders, colors).

Make it stickPractice what you've learned1 quiz · 2 practical tests · Optional activities from HTML CourseBrowse activities
Previous lessonIndexedDB – Browser‑Side Structured DataContinue to lesson 35Web Components – Custom ElementsBack to HTML Course curriculum