Skip to main content
D
HTML
HTML Formatting Elements

HTML Formatting Elements

HTML formatting elements apply semantic meaning to text.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

HTML formats text to convey special meaning. Elements like `` and `` highlight importance and emphasis. Browsers apply visual styles like bold or italic by default.

Syntax

Syntax
1<!-- formatting elements -->
2<p><strong>Strong</strong> and <em>emphasis</em>.</p>

Example

Example
1<!-- this formats text inline -->
2<!DOCTYPE html>
3<html lang="en">
4  <head>
5    <meta charset="UTF-8">
6    <meta name="viewport" content="width=device-width, initial-scale=1.0">
7    <title>Formatting</title>
8  </head>
9  <body>
10    <p>Use <strong>strong</strong> for importance and <em>em</em> for emphasis.</p>
11  </body>
12</html>

Try it Yourself

Hands-on Practice
Modify the code below to see how it affects the output. This is the best way to learn!
Interactive Editor
1234567891011121314151617181920
Live Preview

Key Points

  • Formatting elements give text meaning.
  • The `` tag indicates strong importance.
  • The `` tag indicates emphasis.
  • The `` tag highlights relevant text.

Up Next

Continue your journey with the next topic.

Go to HTML Quotations