4 min read · Free · No login needed
The <head> element holds information about the page. Nothing inside the head is shown on the page itself — but without it, the page would not work properly in browsers or in Google search.
<title> — the browser-tab text and the Google search headline.<meta charset="UTF-8"> — the character encoding. UTF-8 covers every language, including Hindi. Always include it, first thing in the head.<meta name="viewport" content="width=device-width, initial-scale=1.0"> — makes the page fit phone screens. Without it, mobile browsers show a tiny zoomed-out desktop page.<meta name="description"> — a short summary Google may show under your page in search results.<link rel="stylesheet" href="styles.css"> — connects the CSS file.<link rel="icon" href="favicon.png"> — the favicon.<script> — JavaScript that must load before the page (most scripts belong at the end of the body instead).Phones have narrow screens. The viewport tag tells the phone: "this page is designed to be responsive — show it at the device's real width". Every modern page needs it. If you ever open a site on your phone and it looks tiny and zoomed out, that site is missing this one line.
The <head> is the part of the page that the visitor never sees. It holds information about the page: its title, its character set, how it should look on a phone, which stylesheet to load, and how search engines should describe it. The browser reads the head first, before it draws anything.
| Tag | Value | Description |
|---|---|---|
<title> | text | The page title, shown in the tab and in search results. Required. |
<meta charset="utf-8"> | — | The character set. UTF-8 handles every language, including Hindi. |
<meta name="viewport"> | width=device-width | Tells phones to show the page at its real width, not zoomed out. |
<meta name="description"> | text | A short summary Google may show under your link in search results. |
<link> | a file path | Links a stylesheet, a favicon, or a font. |
<style> | CSS rules | CSS written directly in the page. |
<script> | JavaScript | JavaScript, usually with defer when placed in the head. |
<base> | a web address | Sets the base address for all relative links on the page. |
A good head for a real page looks like this:
<head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>My Page</title> <meta name="description" content="A short summary of this page."> </head>
<meta charset="utf-8"> as the very first thing inside the head. If the browser reads any text before it knows the character set, Hindi words and symbols like ₹ can show as broken characters.viewport tag is the single most important line for mobile. Without it, a phone shows your page shrunk to fit, with tiny unreadable text. With it, the page opens at a normal, readable size.<title> — every page needs exactly one.<html lang="en"> — says the page is in English, so screen readers pronounce the words correctly.<meta charset="UTF-8"> — the character set. It comes first in the head, so Hindi words and symbols like ₹ display correctly.<meta name="viewport" content="width=device-width, initial-scale=1.0"> — tells phones to show the page at their real width instead of shrinking the desktop layout.<meta name="description" ...> — a short summary Google may show under the page in search results.<title>HTML Head — KAMALDNP Seekho</title> — the text on the browser tab and the headline in Google.<link rel="stylesheet" href="styles.css"> — connects the CSS file that styles the whole page.<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Learn HTML from scratch with free lessons, examples and a certificate.">
<title>HTML Head — KAMALDNP Seekho</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Page content goes here</h1>
</body>
</html>
Change the code below and press Run to see the result instantly. No file to save, no login needed.
The questions learners ask most about this lesson — read the question, then open it to see the answer.
Information about the page, such as its title, character set, phone layout, stylesheet and search description, none of which shows on the page itself.
So Hindi words and symbols like the rupee sign display correctly instead of showing as broken characters.
It tells phones to show the page at their real width instead of a tiny zoomed-out desktop page.
AI can write code for you, but it cannot think for you. When you learn HTML yourself, your brain builds the real skill: you understand why a page looks the way it does, you can fix it when it breaks, and you can answer it in an exam or an interview without help. That is the skill that gets you a job — not a copied answer.
Finish all 35 lessons, pass the test (80%), pay ₹10 and get your certificate.
Take the testPrefer watching? Video courses teach the same topics step by step.
Free tutorials teach you the basics. Our paid courses add live projects, mentorship and a certificate.
Browse all coursesAsk about courses, website & more
Request human callback:
Please log in to download. You will stay on this page after logging in!
New here? Register now →