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.
Use headings in order. Don’t jump from <h1> directly to <h3>. This confuses both readers and search engines:
<!-- Good: Logical progression -->
<!-- Bad: Skips levels -->
Use <p> for blocks of text:
Sometimes you need a line break without creating a new paragraph. Use <br>:
HTML provides two ways to emphasize text. The key difference is semantic meaning:
Use <strong> when text has strong importance or urgency:
Use <em> to emphasize part of a sentence (like italic text):
Sometimes you just need styling without semantic meaning. Use <b> for bold and <i> for italic:
| Element | Meaning | When to Use |
|---|
<strong> | Strong importance | Warnings, critical info, urgent text |
<b> | Bold styling | Product names, technical terms (no meaning) |
<em> | Emphasis | Stress in a sentence (would change meaning if italicized) |
<i> | Italic styling | Scientific names, foreign words, titles |
You can combine emphasis elements:
Here’s a realistic example combining all these elements:
Write a short article about your favorite topic:
Experiment with:
- Adding more headings and paragraphs
- Using
<strong> for important words
- Using
<em> to emphasize key points
- 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 →