QA
Beginner LevelHTML & Semantic Web

What is the difference between the <head> and <body> elements in an HTML document?

❓ Interview Prompt: Explain the separation of document metadata in <head> versus renderable visible content in <body>.

HTML documents are divided into two main structural sections:

1. '<head>':

Contains metadata NOT directly rendered on the page canvas (title, meta tags, linked CSS stylesheets, favicons, scripts).

2. '<body>':

Contains all visible, renderable content (headings, paragraphs, images, buttons, navigation) that users interact with on the viewport.

Code Implementation Example

html
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Metadata Container</title>
</head>
<body>
  <h1>Visible Content Container</h1>
</body>
</html>
💡Separation between head metadata container and body visible rendering canvas.
🎯 Interview Key Takeaway

Store non-rendered document metadata in <head>; place all visible page markup inside <body>.

#head#body#Document Structure#Beginner
Back to all HTML & Semantic Web Questions→

More HTML & Semantic Web Interview Questions

Beginner LevelHTML & Semantic Web

What is Semantic HTML and why is it essential for modern web applications?

Beginner LevelHTML & Semantic Web

What is <!DOCTYPE html> and what happens if it is omitted?

Beginner LevelHTML & Semantic Web

What is the difference between inline and block-level HTML elements?