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→