Interview answer drill

Use this HTML interview question to rehearse a quick answer, common mistake, follow-up, and production pitfall.

What are HTML tags?Frontend interview answer

MediumEasyHtml
Interview focus

This HTML interview question tests whether you can explain HTML tags explained: semantics, DOM structure, and common markup mistakes, connect it to production trade-offs, and handle common follow-up questions.

  • HTML tags explained: semantics, DOM structure, and common markup mistakes explanation without falling back to memorized docs wording
  • Tags and Elements reasoning, edge cases, and production failure modes
  • How you would answer the most likely HTML interview follow-up
Practice more HTML interview questions
Interview quick answer

HTML tags are the markup primitives browsers parse into a DOM tree. In production, choosing the right tag affects semantics, accessibility, SEO, and how reliably CSS and JavaScript can target the page.

Full interview answer

Core idea

HTML tags are not just angle-bracket syntax. They are the browser's structural hints for building the DOM tree, exposing semantics to assistive tech, and giving CSS and JavaScript reliable hooks. In production, the common mistake is treating every tag like a generic container when headings, landmarks, forms, and links carry meaning that changes accessibility and debugging.

HTML
<!doctype html>
<html>
  <head>
    <title>Profile</title>
  </head>
  <body>
    <h1>Muslum</h1>
    <p>Frontend developer</p>
    <a href="/projects">View projects</a>
  </body>
</html>
                  

Tag

Meaning

When you use it

<h1>...

Main heading

Page or section title.

<p>...</p>

Paragraph text

Normal reading content.

<a>...</a>

Navigation link

Move to another page/section/resource.

<button>...</button>

Action trigger

Submit, open modal, start action.

<section>, <article>, <nav>

Semantic structure

Readable, accessible page layout.

Tags communicate intent, not just markup syntax.

Paired vs void tags

Most tags have opening + closing forms (<p>...</p>). Some are void/self-contained like <img> and
.

HTML
<p>Hello world</p>
<img src="avatar.jpg" alt="Profile photo">
<br>
                  

Common mistakes

  • Using <div> for everything instead of semantic tags.
  • Breaking heading hierarchy (jumping from <h1> to <h4> randomly).
  • Missing important attributes like image alt or link href.

Practical scenario
You build a blog card with <article>, <h2>, <p>, and <a> so users, crawlers, and screen readers all understand content roles immediately.

Trade-off or test tip
Semantic HTML may feel slower at first than dropping <div> everywhere, but it reduces accessibility and maintenance debt long-term.

Still so complicated?

Think of tags as labels on folders. If every folder is named div, your team and assistive tech cannot quickly understand what is inside.

Summary
    <li>Tags define structure and meaning.
  • Browsers convert tags into the DOM tree.
  • Semantic tags improve accessibility, SEO, and maintainability.
  • Good HTML makes CSS/JS simpler and more reliable.
Similar questions
Guides
Preparing for interviews?

Use this as one explanation rep, then continue with the HTML interview questions cluster or a guided prep path.