Content · Web Development · HTML

HTML Comment Thread Markup: Nested Replies and Dates

A comment thread contains independent comments and replies. Each comment needs a clear writer label, text, and, when helpful, a publication date.

1 views Published Oct 19, 2026 Updated Oct 19, 2026 Admin

A comment thread contains independent comments and replies. Each comment needs a clear writer label, text, and, when helpful, a publication date.

What You Need to Know


Nested replies should appear inside the comment they answer so the relationship remains clear. Deep nesting can become hard to navigate, especially on phones.

The goal is not to collect as many tags as possible. Pick the element that best describes what the content really is.

Example: See It in Action


This example keeps the idea small. Copy it carefully, then follow the explanation instead of guessing what the browser will do.

This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.

<section aria-labelledby="comments-title">
    <h2 id="comments-title">Comments</h2>
    <article>
        <h3>Great article!</h3>
        <p>Posted by Mia</p>
        <article>
            <h4>Thanks, Mia!</h4>
            <p>Reply from Alex</p>
        </article>
    </article>
</section>

Let’s Understand the Example


  • Section groups content around a shared topic and usually has a heading.
  • An h2 starts a major section beneath the page topic.
  • Article marks a piece that could make sense on its own, such as a news post or recipe.
  • Aria-labelledby uses one or more existing element ids to name another element.
  • Id gives one element a unique name within the page, so a link, label, or script can point to it.

You should see a readable heading and its related content. The heading level tells readers how the ideas fit together, not merely how large the letters look.

What Should You See?


The page should display “Comments” as a heading, followed by its related content. Change the heading text and refresh the browser to see the result.

Read only the headings, from top to bottom. Do they tell a sensible story? If not, move sections or choose levels that match the content.

Try It Yourself


  1. Add a second reply and make its parent comment clear.
  2. Save your changes, open or refresh the page, and compare the result with the original example.
  3. Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.

Common Beginner Mistakes


  • Using heading levels only to make replies look visually smaller.
  • Avoid picking tags just for their default bold, italic or spaced appearance. Use CSS for presentation.

Key Takeaways


  • A comment thread contains independent comments and replies.
  • Section groups content around a shared topic and usually has a heading.
  • Nested replies should appear inside the comment they answer so the relationship remains clear. Deep nesting can become hard to navigate, especially on phones.
Share this resourceSend this page to someone who may find it useful.