SA-21/06, C-11, Asapur, Varanasi, UP support@kamaldnp.com +91 8318013442
HTML
1. HTML Introduction: What is HTML? Learn with Examples 2. Best Free HTML Editors: Notepad to VS Code for Beginners 3. HTML Basic Structure: Doctype, Head, Body Explained 4. HTML Elements Explained: Tags, Content & Empty Elements 5. HTML Attributes List: href, src, alt, width, title & More 6. HTML Headings h1 to h6: Which Heading Tag to Use When 7. HTML Paragraphs: p Tag, br Line Breaks & pre Text 8. HTML Style Attribute: Colour, Font Size & Alignment 9. HTML Text Formatting Tags: bold, italic, mark & More 10. HTML Comments: How to Add Notes & Hide Code in HTML 11. HTML Colors: Names, HEX, RGB & HSL Colour Codes 12. HTML CSS: Inline, Internal & External Stylesheets 13. HTML Links: a Tag, href, New Tab & Email Links 14. HTML Images: img Tag, src, alt, Width & Formats 15. HTML Favicon: Create & Add a Browser Tab Icon 16. HTML Title Tag: How to Write a Good Page Title 17. HTML Tables: table, tr, th, td, colspan & rowspan 18. HTML Lists: ul, ol, dl & Nested Lists Explained 19. HTML Block vs Inline Elements: div, p, span Explained 20. HTML Div Tag: Group Content & Build Page Layouts 21. HTML Class Attribute: Style Many Elements at Once 22. HTML id Attribute: Unique IDs, Links, CSS & JavaScript 23. HTML Iframes: Embed YouTube, Maps & Pages in HTML 24. HTML JavaScript: script Tag, Clicks & First Example 25. HTML File Paths: Relative vs Absolute Paths Explained 26. HTML Head Element: title, meta, charset & viewport 27. HTML Layout: header, nav, main, footer Page Structure 28. HTML Responsive Design: Viewport, Images & Media Queries 29. Semantic HTML Tags: header, nav, main, article & footer 30. HTML Forms: input, label, select, checkbox & Submit 31. HTML Entities: & < > © with Examples 32. HTML Audio & Video Tags: controls, source & Fallback 33. HTML Accessibility: alt Text, Labels, Landmarks & ARIA 34. HTML Meta Tags & SEO: charset, viewport, OG Tags 35. HTML Quotations: blockquote, q, cite, abbr & address
Final Test — Certificate ₹10
Try this code live
Lesson 26 of 35

HTML Head Element: title, meta, charset & viewport

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.

Diagram — see how it fits together
Infographic: what lives inside the head section

What goes in the head

  • <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).

The viewport tag, in plain words

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.

Tip: The meta description should be one or two sentences, under about 160 characters, and should say what the visitor will find on the page — it is your free advertisement in Google.

What the head is

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.

What goes in the head

TagValueDescription
<title>textThe 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-widthTells phones to show the page at its real width, not zoomed out.
<meta name="description">textA short summary Google may show under your link in search results.
<link>a file pathLinks a stylesheet, a favicon, or a font.
<style>CSS rulesCSS written directly in the page.
<script>JavaScriptJavaScript, usually with defer when placed in the head.
<base>a web addressSets 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>
Note: Put <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.
Tip: The 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.

Common mistakes

  • Forgetting <title> — every page needs exactly one.
  • Putting visible content (headings, paragraphs) inside the head — it belongs in the body.
  • Leaving out the viewport tag — the page looks broken on every phone.
  • Writing the description longer than about 160 characters — Google cuts it off in search results.

Example explained

  • <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.

Example

Example
<!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>

Output

Output — how it looks in the browser
Output of HTML Head Element: title, meta, charset & viewport

Try it yourself — live editor

Change the code below and press Run to see the result instantly. No file to save, no login needed.

Result

Frequently asked questions

The questions learners ask most about this lesson — read the question, then open it to see the answer.

1. What is inside the head element?

Information about the page, such as its title, character set, phone layout, stylesheet and search description, none of which shows on the page itself.

2. Why must charset UTF-8 come first in the head?

So Hindi words and symbols like the rupee sign display correctly instead of showing as broken characters.

3. What does the viewport tag do?

It tells phones to show the page at their real width instead of a tiny zoomed-out desktop page.

Why learn this yourself — and not just ask AI?

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.

Get certified — just ₹10

Finish all 35 lessons, pass the test (80%), pay ₹10 and get your certificate.

Take the test

Prefer watching? Video courses teach the same topics step by step.

Go further with a full course

Free tutorials teach you the basics. Our paid courses add live projects, mentorship and a certificate.

Master Python + AI Skills in 30 Days
₹499
View
Summer Industrial Training in MERN Stack 2026
₹3,000
View
AI Prompt Engineering Webinar 2026
View
Browse all courses
HTML — Lessons
1. HTML Introduction: What is HTML? Learn with Examples 2. Best Free HTML Editors: Notepad to VS Code for Beginners 3. HTML Basic Structure: Doctype, Head, Body Explained 4. HTML Elements Explained: Tags, Content & Empty Elements 5. HTML Attributes List: href, src, alt, width, title & More 6. HTML Headings h1 to h6: Which Heading Tag to Use When 7. HTML Paragraphs: p Tag, br Line Breaks & pre Text 8. HTML Style Attribute: Colour, Font Size & Alignment 9. HTML Text Formatting Tags: bold, italic, mark & More 10. HTML Comments: How to Add Notes & Hide Code in HTML 11. HTML Colors: Names, HEX, RGB & HSL Colour Codes 12. HTML CSS: Inline, Internal & External Stylesheets 13. HTML Links: a Tag, href, New Tab & Email Links 14. HTML Images: img Tag, src, alt, Width & Formats 15. HTML Favicon: Create & Add a Browser Tab Icon 16. HTML Title Tag: How to Write a Good Page Title 17. HTML Tables: table, tr, th, td, colspan & rowspan 18. HTML Lists: ul, ol, dl & Nested Lists Explained 19. HTML Block vs Inline Elements: div, p, span Explained 20. HTML Div Tag: Group Content & Build Page Layouts 21. HTML Class Attribute: Style Many Elements at Once 22. HTML id Attribute: Unique IDs, Links, CSS & JavaScript 23. HTML Iframes: Embed YouTube, Maps & Pages in HTML 24. HTML JavaScript: script Tag, Clicks & First Example 25. HTML File Paths: Relative vs Absolute Paths Explained 26. HTML Head Element: title, meta, charset & viewport 27. HTML Layout: header, nav, main, footer Page Structure 28. HTML Responsive Design: Viewport, Images & Media Queries 29. Semantic HTML Tags: header, nav, main, article & footer 30. HTML Forms: input, label, select, checkbox & Submit 31. HTML Entities: & < > © with Examples 32. HTML Audio & Video Tags: controls, source & Fallback 33. HTML Accessibility: alt Text, Labels, Landmarks & ARIA 34. HTML Meta Tags & SEO: charset, viewport, OG Tags 35. HTML Quotations: blockquote, q, cite, abbr & address
Final Test — Certificate ₹10

🤖 KAMALDNP AI Assistant

Ask about courses, website & more

Hi! I'm KAMALDNP AI Assistant. Ask me about our courses, website features, or anything else! 😊
Please wait 5s...
🤖 KAMALDNP Assistant ✕

Request human callback:

🔐 Login Required
✕

Please log in to download. You will stay on this page after logging in!

New here? Register now →