🚀 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 ///

HTML Text Formatting and Structure

Explore the primary formatting tags of HTML5. Master list structures, learn the semantic difference between emphasis and style, and discover how to use mathematical markers.

Narrated Video Summary
data-composition-id="html-html-common-tags"1280×720 @ 30fps9 clips2:57 total

Text Formatting and Structure

HTML provides a rich, semantic catalog of elements designed to format and structure text. A well-organized document establishes a logical hierarchy that browsers, search engines, and screen readers can interpret. Let's master these core formatting tags.

Heading Hierarchy

HTML provides six levels of heading elements, `<h1>` through `<h6>`, establishing the document's architectural outline. The `<h1>` represents the main page title. It is critical for accessibility to use headings sequentially without skipping levels.

Grouping Data with Lists

HTML offers semantic lists to group related data. Unordered lists (`<ul>`) are used when the sequence is irrelevant, automatically rendering with bullets. Ordered lists (`<ol>`) are for sequential instructions, rendering numbered steps. Every item must be wrapped in a List Item (`<li>`) tag.

Semantic Emphasis

Modern web development heavily distinguishes between how text *looks* and what it *means*. The `<strong>` element dictates strong importance, typically rendering bold. The `<em>` element indicates stress emphasis, rendering italics. Screen readers actively change vocal inflection when reading these tags.

Granular Formatting Elements

HTML includes specialized inline elements. The `<mark>` tag highlights text for reference. The `<small>` element represents side comments like legal disclaimers. To show edits over time, pair `<del>` (deleted text) with `<ins>` (inserted text) to clearly communicate updates, like a price drop.

Technical Typography & Breaks

For complex formulas, HTML provides Superscript (`<sup>`) and Subscript (`<sub>`) to shift text above or below the baseline. Additionally, to represent a thematic break—such as a shift in topic—use the `<hr>` element. It visually renders as a horizontal line, dividing distinct sections.

Bringing It All Together

Combining multiple formatting tags transforms raw text into a highly readable, professionally structured document. By leveraging ordered lists, semantic emphasis, thematic breaks, and headings, the browser paints a rich typographic experience optimized for automated indexing systems.

Formatting Mastery Achieved

Excellent work! You now possess a comprehensive technical toolbox of semantic HTML formatting elements capable of structuring any complex piece of text. With headings, lists, and inline tags fully mastered, you are ready to construct complex page layouts.

0:00 / 2:57
Scene 1 / 9 — Text Formatting and Structure
Total XP: 0|💻 html XP: 0

Skill Matrix

UNLOCK NODES BY LEARNING NEW TAGS.

Formatting Node

Mastering the text catalog.


🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.

HTML is more than just headers and paragraphs. It's a precise system for emphasizing, grouping, and styling information through a rich catalog of dedicated elements designed for semantic clarity.

1Heading Hierarchy

HTML provides six levels of heading elements, <h1> through <h6>, establishing the document's architectural outline. The <h1> represents the main page title. It is critical for accessibility and SEO to use headings sequentially without skipping levels (e.g., don't jump from <h2> directly to <h4>).

Screen readers rely heavily on this predictable outline to allow visually impaired users to navigate the document structure. Treat headings as an ordered table of contents, not as a shortcut to make text visually larger.

+
<!-- Logical Document Outline -->
<h1>Main Application Title</h1>

<h2>User Dashboard</h2>
  <h3>Recent Activity</h3>
  <h3>Account Settings</h3>
localhost:3000

Main Application Title

User Dashboard

Recent Activity

Account Settings

2Grouping Data with Lists

HTML offers precise semantic lists to group related data sets. Unordered lists (<ul>) are utilized when the exact sequence of items is structurally irrelevant, automatically rendering with simple bullet points.

In contrast, Ordered lists (<ol>) are strictly reserved for sequential instructions where the order matters significantly, rendering numbered steps. Within both structures, every individual item must be explicitly wrapped in a List Item (<li>) tag.

+
<!-- Sequential Order matters -->
<ol>
  <li>Fetch data from API</li>
  <li>Parse JSON payload</li>
  <li>Render UI components</li>
</ol>
localhost:3000
  1. Fetch data from API
  2. Parse JSON payload
  3. Render UI components

3Semantic Emphasis

Modern web architecture heavily distinguishes between how text *looks* visually and what it *means* semantically. The <strong> element explicitly dictates strong logical importance, typically rendering as bold.

The <em> element indicates stress emphasis within a sentence, typically rendering as italics. Screen readers actively change their vocal inflection when processing these tags. If you just want text to visually look bold without conveying structural importance, use CSS instead.

+
<!-- Semantic meaning, not just styling -->
<p>
  <strong>Critical Warning:</strong>
  You <em>must</em> deploy the hotfix immediately.
</p>
localhost:3000

Critical Warning: You must deploy the hotfix immediately.

4Granular Formatting Elements

HTML includes specialized inline elements for specific data patterns. To display dynamic edits over time within an application, you should pair the <del> (deleted text) tag with the <ins> (inserted text) tag. This communicates a state change, such as a price drop.

Additionally, the <mark> tag explicitly highlights text for visual reference, and the <small> element represents side comments, such as copyright notices or legal disclaimers, effectively reducing their semantic weight.

+
<!-- Tracking content state changes -->
<p>
  Current Subscription Price:
  <del>$50/month</del>
  <ins>$35/month</ins>
</p>
localhost:3000

Current Subscription Price: $50/month $35/month

5Step-by-Step Breakdown

Text Formatting and Structure. HTML provides a rich, semantic catalog of elements designed to format and structure text. A well-organized document establishes a logical hierarchy that browsers, search engines, and screen readers can interpret. Let's master these core formatting tags.

Heading Hierarchy. HTML provides six levels of heading elements, <h1> through <h6>, establishing the document's architectural outline. The <h1> represents the main page title. It is critical for accessibility to use headings sequentially without skipping levels.

Heading Hierarchy. Which HTML heading element should typically only be used once per page because it represents the main document title and is crucial for Search Engine Optimization?

  • h1
  • h2
  • h6

Grouping Data with Lists. HTML offers semantic lists to group related data. Unordered lists (<ul>) are used when the sequence is irrelevant, automatically rendering with bullets. Ordered lists (<ol>) are for sequential instructions, rendering numbered steps. Every item must be wrapped in a List Item (<li>) tag.

Sequential Lists. Ordered lists are incredibly useful for writing recipes or tutorials because the browser handles numbering automatically. Which specific tag would you use to initiate a numbered list sequence?

  • ul
  • ol
  • list

Semantic Emphasis. Modern web development heavily distinguishes between how text *looks* and what it *means*. The <strong> element dictates strong importance, typically rendering bold. The <em> element indicates stress emphasis, rendering italics. Screen readers actively change vocal inflection when reading these tags.

Semantic Importance. Modern web development prioritizes meaning. Which tag should you use to indicate that text has strong importance or urgency, rather than just visually making it bold for decorative purposes?

  • b
  • strong
  • bold

Granular Formatting Elements. HTML includes specialized inline elements. The <mark> tag highlights text for reference. The <small> element represents side comments like legal disclaimers. To show edits over time, pair <del> (deleted text) with <ins> (inserted text) to clearly communicate updates, like a price drop.

Tracking Document Edits. When managing content that changes over time, it is semantically valuable to show what information was removed. Which HTML tag would you use to indicate that a specific piece of text has been 'deleted' or is no longer accurate?

  • mark
  • del
  • remove

Technical Typography & Breaks. For complex formulas, HTML provides Superscript (<sup>) and Subscript (<sub>) to shift text above or below the baseline. Additionally, to represent a thematic break—such as a shift in topic—use the <hr> element. It visually renders as a horizontal line, dividing distinct sections.

Thematic Break. When you need to logically divide distinct sections of content (which visually renders as a horizontal line), which empty element should you use?

  • br
  • hr
  • line

Bringing It All Together. Combining multiple formatting tags transforms raw text into a highly readable, professionally structured document. By leveraging ordered lists, semantic emphasis, thematic breaks, and headings, the browser paints a rich typographic experience optimized for automated indexing systems.

Formatting Mastery Achieved. Excellent work! You now possess a comprehensive technical toolbox of semantic HTML formatting elements capable of structuring any complex piece of text. With headings, lists, and inline tags fully mastered, you are ready to construct complex page layouts.

Cite A Quotation Properly. <blockquote> marks quoted content; <cite> inside it names the source.

Level Up 🚀

Advanced cheat sheets, SEO tricks, and interview prep for this topic.

Browser Support

ChromeSupported

Fully supported.

FirefoxSupported

Fully supported.

SafariSupported

Fully supported.

EdgeSupported

Fully supported.

Accessibility (A11y)

1Headings Are a Navigation Tool, Not a Font-Size Shortcut

Screen reader users frequently navigate pages by jumping between headings using a single keystroke. Using `<h3>` purely because you want smaller bold text — while skipping the actual `<h2>` — breaks that navigation model and hides real structure from assistive tech.

<h2>Section</h2> <h3>Subsection</h3>

2`<strong>` and `<em>` Change What's Spoken, Not Just How It Looks

Screen readers can alter vocal emphasis for `<strong>` and `<em>`, but say `<b>` and `<i>` with completely flat inflection. If the emphasis is semantically real, not just decorative, use the semantic tags.

SEO Implications

  • 1

    The `<h1>` Is a Strong Topical Signal

    Search engines weight a page's single `<h1>` heavily when determining its primary topic. Missing an `<h1>`, using more than one, or burying it deep in the DOM measurably weakens topical relevance signals for that page.

  • 2

    Skipped Heading Levels Confuse Content Outlining Tools

    Search engines and browser reader-mode tools build a document outline from your heading hierarchy. Jumping from `<h2>` straight to `<h4>` produces a broken, illogical outline that can misrepresent how your content is actually organized.

Best Practices

Reserve `<h1>` for the Single Page Title

Exactly one `<h1>` per page, matching the actual primary topic — not a generic site-wide slogan repeated across every route.

Choose `<ol>` vs `<ul>` Based on Whether Order Is Meaningful

A recipe's numbered steps must be `<ol>` since the sequence carries the meaning. A list of product features with no inherent order should be `<ul>` — using `<ol>` there falsely implies a required sequence.

Frequent Bugs

THE BUG

A screen reader user reports the page 'jumps around confusingly' when navigating by heading.

THE FIX

Audit the document for skipped heading levels (e.g., `<h2>` directly to `<h4>`) or headings used purely for visual sizing rather than real structure, and correct the hierarchy to match the actual content outline.

THE BUG

`<strong>` text isn't rendering bold even though the tag is clearly in the markup.

THE FIX

A CSS reset or component library stylesheet is likely overriding the default `font-weight` on inline elements. Check computed styles in DevTools — the semantic tag is still correct for accessibility even if you need to add explicit CSS to restore the visual weight.

Real-World Examples

Article Page Heading Outline

A blog post uses a single `<h1>` for the article title, `<h2>` for major sections, and `<h3>` for subsections — giving both search engines and screen reader users an identical, predictable outline of the content.

<h1>How Browsers Parse HTML</h1>
<h2>Tokenization</h2>
<h3>State Machine Basics</h3>
<h2>Tree Construction</h2>

Interview Prep

?Frequently Asked Questions

Pascual Vila

Pascual Vila

Frontend Instructor // Code Syllabus

Common Pitfalls & Errors

The Error //

Missing closing tags

<!-- Wrong --> <div> <p>Some text </div> <!-- Correct --> <div> <p>Some text</p> </div>

The Solution //

Always ensure that every opening tag has a corresponding closing tag, unless it is a self-closing element like <img> or <br>.

The Error //

Using unquoted attributes

<!-- Wrong --> <div class=container id=main> <!-- Correct --> <div class="container" id="main">

The Solution //

While HTML5 permits unquoted attributes in some cases, it's a best practice to always wrap attribute values in double quotes.

Lesson Glossary

[01]ul

Unordered List. A collection of items where the order does not matter (renders with bullets).

Code Preview
<ul>

[02]ol

Ordered List. A collection of items where the order DOES matter (renders with numbers).

Code Preview
<ol>

[03]li

List Item. Used inside <ul> or <ol> to define a single point in the list.

Code Preview
<li>

[04]strong

Indicates that its contents have strong importance, seriousness, or urgency.

Code Preview
<strong>

[05]em

Indicates stress emphasis, typically rendered in italics.

Code Preview
<em>

[06]mark

Used to highlight text that is particularly relevant in a specific context.

Code Preview
<mark>

[07]hr

Horizontal Rule. Represents a thematic break between paragraph-level elements.

Code Preview
<hr>

Continue Learning