The <head> holds metadata — information about the page rather than its visible content. Getting it right controls how your page appears in search results, on social media, and on different devices.
Essential head elements
<head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Page Title — Site Name</title><meta name="description" content="A concise summary for search results." /><link rel="stylesheet" href="styles.css" /><link rel="icon" href="favicon.ico" /><!-- Open Graph: how the page looks when shared --><meta property="og:title" content="Page Title" /><meta property="og:image" content="preview.jpg" /></head>
Key takeaways
- 01The <head> holds metadata: charset, viewport, title, description, links, favicon.
- 02The <title> is the tab name and search headline; meta description is the search snippet.
- 03Open Graph (og:) tags control social-media share previews.
- 04Good head metadata controls search appearance, sharing and device rendering.
