HTML Tutorial Series – Chapter 2: Headings, Paragraphs & Text Formatting
Introduction
Now that you understand the basic structure of an HTML document, it’s time to start working with actual content.
In this chapter, you’ll learn how to:
- Add headings and paragraphs
- Control spacing and layout
- Format text to make it more readable and meaningful
These are the most commonly used HTML tags, and you’ll use them on almost every webpage you build.
HTML Headings (h1 to h6)
- Headings are used to define titles and subtitles on a webpage. HTML provides six levels of headings, from
<h1>(most important) to<h6>(least important).
Main Heading (H1)
Subheading (H2)
Section Title (H3)
Subsection (H4)
Small Heading (H5)
Smallest Heading (H6)
Best Practices:
- Use only one
<h1>per page (important for SEO). - Follow a proper hierarchy (
h1 → h2 → h3). - Don’t skip levels unnecessarily.
👉 Think of headings like a book structure — title, chapters, sections, and sub-sections.
Paragraph Tag (<p>)
The <p> tag is used to write paragraphs of text.
This is a paragraph. It contains some text for the reader.
This is another paragraph. Each paragraph starts on a new line.
Key Points:
- Browsers automatically add spacing between paragraphs.
- Extra spaces in HTML are ignored.
Line Break (<br>) and Horizontal Rule (<hr>)
- Line Break (
<br>)
Used to break a line without starting a new paragraph.
This is line one.
This is line two.
- Horizontal Line (
<hr>)
Creates a horizontal divider between sections.
Use <hr> to separate content visually (like sections in an article).
Text Formatting Tags HTML provides several tags to format text and give it meaning. Let’s explore them one by one:
- Bold & Importance
This is bold text
This is important text
<strong> is preferred because it adds semantic importance (useful for SEO and accessibility).
- Italic & Emphasis
This is italic text
This is emphasized text
<em> is better for meaning, not just style.
-
Underline, Highlight & Small Text
Underlined text
Highlighted text
Small text
Deleted & Inserted Text
Deleted text
Inserted text
Useful for showing updates or edits in content.
Subscript & Superscript
H2O
E = mc2
Commonly used in science and math content.
Semantic Text Tags (Meaningful Content)
These tags help browsers and search engines understand your content better.
Abbreviation (
<abbr>)
HTML
Shows full form on hover.
Short Quote (
<q>)
This is a short quote
Block Quote (
<blockquote>)
This is a long quotation from another source.
Citation (
<cite>)
Harry Potter
Address (
<address>)
123 Street, Ahmedabad, India
Time (
<time>)
Definition (
<dfn>)
HTML is the standard language for web pages.
Code-Related Tags
Perfect for technical blogs like yours
Inline Code (
<code>)
console.log("Hello World");
Keyboard Input (
<kbd>)
Press Ctrl + C to copy.
Sample Output (
<samp>)
Output: Hello World
Variable (
<var>)
x + y = z
Preformatted Text (<pre>)
Displays text exactly as written (keeps spaces and line breaks).
This is preformatted text.
It preserves spacing.
Direction & Isolation Tags
Useful for multilingual or special text formatting:
Username123
This text is reversed
Rarely used, but important for advanced HTML handling.
Key Takeaways from Chapter 2
- Headings define structure and improve SEO.
- Paragraphs are used for content blocks.
- Formatting tags enhance readability and meaning.
- Semantic tags help search engines and accessibility tools understand your content better.
Rarely used, but important for advanced HTML handling.
What’s Next?
In the next chapter, you’ll learn how to make your webpage more interactive and engaging by adding:
- Links
- Images
- Audio & Video
👉 Next: Chapter 3 – Links, Images & Multimedia
