热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

Chapter 2

HTML Document Structure, DOCTYPE, Head, Body, and Metadata

Learn the basic skeleton of every HTML document and understand why metadata matters for browsers, SEO, sharing, and user experience.

Inside this chapter

  1. The Basic HTML Skeleton
  2. What the DOCTYPE Does
  3. What Belongs in Head vs Body
  4. Important Metadata
  5. Why Language Attribute Matters
  6. Professional Habit to Build Early

Series navigation

Study the chapters in order for the clearest path from HTML basics and document structure to semantics, accessibility, SEO, maintainability, and advanced markup practice. Use the navigation at the bottom to move smoothly through the full tutorial series.

Tutorial Home

Chapter 2

The Basic HTML Skeleton

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My First Page</title>
</head>
<body>
  <h1>Hello HTML</h1>
</body>
</html>

This skeleton is the starting point for nearly every HTML page. Students should understand what each part contributes before moving forward.

Chapter 2

What the DOCTYPE Does

The <!DOCTYPE html> declaration tells the browser to render the page in standards mode. Without it, browsers may fall back to older compatibility behavior that can create layout and parsing issues.

Chapter 2

What Belongs in Head vs Body

The <head> contains metadata such as title, charset, viewport settings, stylesheets, icons, descriptions, and social sharing information. The <body> contains the visible document content users interact with.

Chapter 2

Important Metadata

  • Page title for browser tabs and search display
  • Description metadata for search and previews
  • Viewport settings for responsive behavior
  • Charset declaration for correct text interpretation
  • Open Graph and sharing metadata for social platforms
Chapter 2

Why Language Attribute Matters

The lang attribute on the <html> element helps assistive technologies, search engines, and browser tools interpret the document language correctly.

Chapter 2

Professional Habit to Build Early

Students should treat document setup as part of page quality, not as filler. Many production issues involving SEO, mobile rendering, text encoding, or sharing previews come from weak or missing metadata.

版权所有 © 2026,WithoutBook。