Junior JavaScript

What is the difference between <header> and <head>?

  • <head> holds metadata (title, styles, scripts).
  • <header> defines the visible top section of the page (logo, navigation, heading).

Example:

<head>

<title>My Portfolio</title>

</head>

<header>

<h1>Welcome to My Portfolio</h1>

</header>

Follow me on LinkedIn:

Key Takeaway:

<head> = document info; <header> = visible header area.

More from JavaScript Tutorial

All questions for this course