Skip to content

Text and Headings

Text is the foundation of web content. In this tutorial, you’ll learn how to organize and emphasize text using HTML’s heading and text elements.

What you’ll learn:

  • How to use heading levels (h1 through h6)
  • Creating paragraphs and line breaks
  • Emphasizing text with bold and italic
  • The difference between semantic and non-semantic emphasis
  • Best practices for readable content

Prerequisites:


HTML provides six heading levels: <h1> through <h6>. Use them to structure your content from most to least important.

Result

Use headings in order. Don’t jump from <h1> directly to <h3>. This confuses both readers and search engines:

<!-- Good: Logical progression -->
<h1>Blog Post Title</h1>
<h2>Introduction</h2>
<h2>Main Topic</h2>
<h3>Subtopic A</h3>
<h3>Subtopic B</h3>
<!-- Bad: Skips levels -->
<h1>Blog Post Title</h1>
<h3>Subtitle</h3>

Use <p> for blocks of text:

Result

Sometimes you need a line break without creating a new paragraph. Use <br>:

Result

HTML provides two ways to emphasize text. The key difference is semantic meaning:

Use <strong> when text has strong importance or urgency:

Result

Use <em> to emphasize part of a sentence (like italic text):

Result

Sometimes you just need styling without semantic meaning. Use <b> for bold and <i> for italic:

Result
ElementMeaningWhen to Use
<strong>Strong importanceWarnings, critical info, urgent text
<b>Bold stylingProduct names, technical terms (no meaning)
<em>EmphasisStress in a sentence (would change meaning if italicized)
<i>Italic stylingScientific names, foreign words, titles

You can combine emphasis elements:

Result

Here’s a realistic example combining all these elements:

Result

Write a short article about your favorite topic:

Result

Experiment with:

  1. Adding more headings and paragraphs
  2. Using <strong> for important words
  3. Using <em> to emphasize key points
  4. Try combining <strong> and <em>


  • Use <h1> through <h6> to structure content hierarchically
  • Each page should have exactly one <h1>
  • Use <p> for paragraphs
  • Use <strong> for important content, <b> for styling
  • Use <em> for emphasis, <i> for italics without semantic meaning
  • Emphasis elements should enhance readability, not replace headings

Links & Images

Connect pages with links and add visual content with images. Continue →

Lists

Organize information with unordered and ordered lists. Continue →