Basic HTML Tags — HTML Technical Interview Questions & Answers

The minimal skeleton: html, head, body.

Basic HTML Tags

  • The minimal skeleton: html, head, body.
  • Basic tags: html, head, title, body, h1–h6, p, a, img, ul/ol/li, div, span. Opening <p> and closing </p>. Empty tags like <img> and <br> have no content.
  • Nest properly: don’t put a <p> around a <div>. Indent so you can see the tree.
  • Trap: unclosed tags. Trap: <b> instead of <strong> when you mean importance (know both).

Technical Interview Tip: <h1>Marks</h1><p>Hello</p>

Code Examples for Basic HTML Tags

Basic HTML Tags — working example

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>HTML basics</title>
  </head>
  <body>
    <!-- Comment: structure first, then content -->
    <h1 id="top" class="title">Hello HTML</h1>
    <p>Elements wrap content; attributes like <code>id</code> and <code>class</code> add meaning.</p>
    <img src="/images/team.jpg" alt="Team practicing interviews" width="320" />
  </body>
</html>

Basic HTML Tags — hTML structures content with elements and attributes; start every page with doctype, html, head, and body.

How to Explain Basic HTML Tags to an Interviewer

Name five basic tags.

h1 p a img body