head
The container for document metadata.
Learn head, title, meta, link as part of the HTML element system: when to use it, how it fits inside a document and what mistakes to avoid.
Metadata
Metadata elements live inside head. They do not create visible page content, but they affect encoding, responsive behavior, page titles, stylesheets, icons, search snippets and sharing previews.
Good metadata is quiet infrastructure. Users may not notice it directly, but browsers, search engines and social platforms depend on it.
head, title, meta, link. Information for browsers, search engines, CSS, icons and sharing previews. Syntax in context
A useful head usually starts with charset and viewport, then title, description and links to assets.
<head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>HTML Metadata Lesson | Full Stack Masterclass</title> <meta name="description" content="Learn how HTML metadata helps browsers and search engines understand a page."> <link rel="stylesheet" href="assets/css/styles.css"> </head>
Good versus weak
<head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>HTML Metadata Lesson | Full Stack Masterclass</title> <meta name="description" content="Learn how HTML metadata helps browsers and search engines understand a page."> <link rel="stylesheet" href="assets/css/styles.css"> </head>
<head> <title>Home</title> <meta name="keywords" content="html, html, html, best html"> </head>
HTML quick reference
Use these patterns when you need the syntax quickly. Each example has its own anchor, so search engines and readers can land directly on the exact pattern instead of only at the top of the lesson.
A clean version of the markup from this lesson. Use it when you need the correct HTML shape quickly.
<head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>HTML Metadata Lesson | Full Stack Masterclass</title> <meta name="description" content="Learn how HTML metadata helps browsers and search engines understand a page."> <link rel="stylesheet" href="assets/css/styles.css"> </head>
Meaningful markup that stays understandable before CSS and JavaScript are added.
The starting point from the practice lab. Change the HTML first, then use CSS only for presentation.
<main class="demo-card"> <p class="label">Metadata lesson</p> <h1>Head content is invisible but powerful</h1> <p>The visible preview is only body content. The metadata belongs in head and describes the document.</p> </main>
A complete practice snippet that shows how the HTML behaves in context.
A weak pattern from the lesson. Use it as a warning sign when reviewing real pages.
<head> <title>Home</title> <meta name="keywords" content="html, html, html, best html"> </head>
A recognizable mistake you can search for and refactor.
Rules that matter
Place meta charset near the top so text encoding is known early.
Responsive pages need a viewport meta tag.
A title should identify the page, not only the site.
Modern SEO rewards useful metadata, not repeated keyword lists.
Production thinking
Beginners often ask why this is not just a div with styling. The reason is that HTML is read by browsers, search engines, screen readers and future developers. Clear meaning makes the page easier to use and maintain.
The title is announced by assistive technology and helps users understand which tab or page they are on.
Generate title, description and canonical URL per page. Reusing the same metadata everywhere weakens the site.
Live code lab
Edit the HTML or CSS, then use Run to refresh the preview. The preview is isolated, so links and forms stay inside this practice area.
Mini assignment
Practice assignment
Try it yourself
Self-check
Do not only read this page. Answer these questions out loud or write the answers in your own notes. If one answer feels vague, revisit the examples before moving on.