Coding Now – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 9667708830
Back to HTML Notes
Topic #815

header vs head

Two similarly-named, completely unrelated elements. <head> holds invisible page metadata. <header> holds visible introductory content. Mixing them up is one of the most common beginner errors.

Side by Side

<head><header>
Visible to the user?No — never rendered as page contentYes — normal visible content
Where it goesOnce, directly inside <html>, before <body>Inside <body> — can appear multiple times
What it containsTitle, meta tags, links to CSS/fonts, scriptsLogo, page/section title, navigation
How many per pageExactly oneZero, one, or several (one per section that needs one)

Example — Both, Correctly Used

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CodingNow</title>
</head>
<body>
    <header>
        <h1>CodingNow</h1>
    </header>
    ...
</body>
</html>

Common Mistakes

  • Putting a site logo or visible heading inside <head> — it simply won't display
  • Trying to add a <title> or <meta> tag inside <header> instead of <head>
  • Assuming they're just capitalization/naming variants of the same idea

Interview Relevance

A quick, easy-to-answer-correctly question that still trips up a surprising number of beginners in practice — good to have a crisp, confident answer ready.

Practice Question

Identify the error: a developer put <meta name="description" content="..."> inside the page's <header> element. Explain the fix.

Related HTML Notes

Want to go beyond the notes?

Join CodingNow's HTML course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →