Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Metadata – Charset, Viewport, HTTP‑Equi | HTML Course lesson | BraveProgrammer
  1. Courses
  2. /
  3. HTML Course

Lesson 24 of 55

·HTML

Metadata – Charset, Viewport, HTTP‑Equiv

8 min

Course progress44%

What you'll learn

Keep these ideas in mind as you work through the lesson.

5 points
  • Defining character encoding with `<meta charset>` and why it must be first
  • Using `http-equiv` for compatibility directives (`X-UA-Compatible`)
  • Author and theme metadata for credit and PWA theming
  • Order of meta tags for optimal performance and rendering
  • Complementing with `<meta name='viewport'>` for responsive behaviour

Essential Meta Tags

<meta charset='UTF-8' />
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta name='author' content='John Smith' />
<meta name='theme-color' content='#317EFB' />

Purpose

  • charset – Declares character encoding (UTF‑8 recommended). Must be the first meta tag.
  • http-equiv – Provides HTTP‑header equivalents; X-UA-Compatible forces modern Edge/IE rendering mode.
  • author, theme-color – Metadata for author credit and PWA theming on mobile browsers.

Placement

Always place the charset meta tag as the first element inside <head> to avoid rendering glitches. The viewport meta tag (see Lesson 25) should follow immediately after.


Quick checklist for meta tags

  1. <meta charset> first in <head>? ✅
  2. http-equiv='X-UA-Compatible' present for legacy support? ✅
  3. Author and theme metadata added where appropriate? ✅
  4. Viewport meta tag included (see Lesson 25)? ✅

Tip: When you add a language version of a page, also add a hreflang link in the head to help search engines serve the correct regional version.

Make it stickPractice what you've learned1 quiz · 2 practical tests · Optional activities from HTML CourseBrowse activities
Previous lessonBasic Document StructureContinue to lesson 25Open Graph & Twitter Card TagsBack to HTML Course curriculum