🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
HTML MASTER CLASS /// LEARN TAGS /// BUILD STRUCTURE /// SEMANTIC WEB /// HTML MASTER CLASS /// LEARN TAGS ///
Total XP: 0|💻 html XP: 0

HTML Text Formatting

Learn about Text Formatting in this comprehensive HTML5 web development tutorial. Learn to distinguish between visual and semantic formatting. Master the use of strong, em, code, and mark tags to create accessible and technically sound text blocks.

LOADING ENGINE...

Skill Matrix

UNLOCK NODES BY LEARNING NEW TAGS.

Formatting Node

Semantic Emphasis.


HTML isn't just about the words; it's about the weight you give them. Mastering semantic formatting ensures your message is clear to both humans and machines.

1Semantic Weight vs. Visual Style

Historically, developers used the <b> (bold) and <i> (italic) tags to format text. However, these tags are purely visual—they tell the browser how to render the text, but they convey zero meaning to assistive technologies or search engines.

Modern web architecture demands semantic rigor. Instead of <b>, you must use the <strong> tag to indicate that a piece of text has critical, urgent importance. Instead of <i>, use the <em> tag to indicate stress emphasis. Screen readers actively change their vocal intonation when they encounter these tags. Using semantic formatting is the difference between a page that merely looks right and a page that actually works for all users.

+
<!-- Semantic Importance -->
<p>
  <strong>Warning:</strong> Do <em>not</em> reboot.
</p>
localhost:3000
Browser Output

Warning: Do not reboot.

2Technical and Contextual Formatting

When documenting software or referencing specific data, you need specialized modifiers. The <code> tag is explicitly designed to distinguish actionable computer code from conversational prose. The browser will natively render this using a monospace typeface.

Additionally, the <mark> tag is used to highlight text for contextual relevance—imagine using a yellow highlighter in a textbook. This is aggressively used in search interfaces to instantly draw the user's eye to their query term within a large block of text. These tags provide immediate clarity without forcing you to write complex CSS.

+
<p>Run <code>npm install</code>.</p>
<p>Result: <mark>Success</mark>.</p>
localhost:3000
Browser Output

Run npm install.

Result: Success.

3Document Tracking and Citations

When data changes, you shouldn't just delete the old text. By using the <del> (deleted) and <ins> (inserted) tags, you programmatically document the revision history of the page. Browsers natively strike through the deleted text and underline the inserted text, providing instant transparency for price drops or corrected information.

Similarly, when importing external data, the <blockquote> element is mandatory for extended quotations. It explicitly links the borrowed text to a source and structurally distances it from your own prose.

+
<p>Price: <del>$50</del> <ins>$40</ins></p>

<blockquote>
  Data is the new oil.
</blockquote>
localhost:3000
Browser Output

Price: $50 $40

Data is the new oil.

?Frequently Asked Questions

Pascual Vila

Pascual Vila

Frontend Instructor // Code Syllabus

Lesson Glossary

[01]strong

An element used to indicate that its contents have strong importance, seriousness, or urgency.

Code Preview
<strong>

[02]em

Emphasis; an element used to indicate stress emphasis on its contents.

Code Preview
<em>

[03]code

An element used to represent a fragment of computer code.

Code Preview
<code>

[04]mark

An element used to represent highlighted text for reference purposes.

Code Preview
<mark>

[05]b (Bold)

A legacy element that specifies bold text without any extra semantic importance.

Code Preview
<b>

[06]i (Italic)

A legacy element that specifies italic text without any extra semantic importance.

Code Preview
<i>

[07]Monospace

A font where each character takes up the same amount of horizontal space, used for code.

Code Preview
UI

Continue Learning