HTML · The document layer

What is document metadata and where does it go?

MediummetadataheadtitleUpdated Oct 2026
Quiz this track

Short answer

Document metadata is everything in the head that describes or loads resources for the page: title, meta tags, link tags, scripts and styles. It is not rendered as page content.

The head is the document's control panel. It tells the browser the character encoding, the page title, the viewport behaviour and which external resources to load.

  • title names the document in tabs, history, bookmarks and search results
  • meta carries name-value metadata
  • link connects related resources such as stylesheets, icons and canonical URLs
  • script can load JavaScript, ideally with defer or async
  • style can contain inline CSS, though external stylesheets are usually preferable
html
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>HTML interview questions | Vocal Hire</title>
  <link rel="stylesheet" href="/styles.css" />
  <link rel="canonical" href="https://example.com/questions/html" />
  <script src="/app.js" defer></script>
</head>

Metadata order matters in a few cases. charset should be early, and the viewport tag should be present before the page is rendered so mobile scaling is correct. The title should be unique and descriptive.

Do not put visible content in the head. Browsers may move unexpected content into the body, producing a document that does not match what you wrote.

Follow-ups you should expect

Interviewers use these to check whether the first answer was understanding or memorisation.

  1. 1What is the difference between link and a?
  2. 2Where should scripts go in the document?
  3. 3Why should the title be unique per page?
  4. 4Can you have more than one title element?

Say it in the interview

Document metadata is what lives in the head: the title, meta tags, linked stylesheets and icons, and script tags. It is not visible page content; it tells the browser and crawlers about the page. I put charset early, include the viewport tag, use a unique descriptive title, and load scripts with defer or async where possible. Visible content belongs in the body.

Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.

Related questions

Reading is step one

Now say it out loud.

Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live HTML mock interview and get scored feedback on depth, clarity and confidence.