--- id: html-vs-xhtml title: "HTML vs XHTML" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["XHTML", "HTML versus XHTML", "Extensible HyperText Markup Language", "well-formed HTML", "XHTML rules", "XHTML vs HTML"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.89 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["html", "web", "frontend", "xhtml", "xml", "w3schools"] raw_sources: ["https://www.w3schools.com/html/html_xhtml.asp"] applied_in: [] github_commit: "" --- # [[HTML vs XHTML]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) XHTML (Extensible HyperText Markup Language) is a stricter, XML-based reformulation of HTML that enforces "well-formed" markup β€” every element properly nested, closed, lowercase, and quoted β€” where HTML browsers would normally tolerate errors. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **XHTML = Extensible HyperText Markup Language** β€” a stricter, more XML-based version of HTML; HTML defined as an XML application, supported by all major browsers. [S1] - **Why XHTML** β€” XML requires documents to be properly marked up and "well-formed." XHTML enhances HTML's extensibility and compatibility with other XML data formats and enforces stricter error handling than HTML. [S1] - **HTML is lenient, XHTML is strict** β€” browsers tolerate HTML errors and render anyway; XHTML enforces stricter standards. [S1] - **Nine core differences** β€” mandatory DOCTYPE and `xmlns`, mandatory structural elements, proper nesting, mandatory closing, lowercase elements and attribute names, quoted attribute values, and no attribute minimization. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Mandatory document skeleton** β€” `` + `` + `` + `` + `<body>`. [S1] - **Self-closing empty elements** β€” `<br />`, `<hr />`, `<img ... />`. [S1] - **Full attribute form** β€” `checked="checked"` rather than bare `checked`. [S1] - **Quoted + lowercase** β€” all attribute values quoted; all element and attribute names lowercase. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **What is XHTML?** XHTML stands for E**X**tensible **H**yper**T**ext **M**arkup **L**anguage. It is a stricter, more XML-based version of HTML β€” HTML defined as an XML application β€” and is supported by all major browsers. [S1] **Why XHTML?** XML is a markup language where all documents must be properly marked up and "well-formed." XHTML was developed to make HTML more extensible and compatible with other data formats such as XML. In addition, browsers tend to ignore HTML errors and try to display the website even if it has errors in the markup; XHTML enforces stricter error handling. [S1] **The Most Important Differences from HTML** Nine mandatory XHTML requirements: [S1] - `<!DOCTYPE>` declaration is mandatory. - The `xmlns` attribute in `<html>` is mandatory. - `<html>`, `<head>`, `<title>`, and `<body>` are mandatory. - Elements must be properly nested. - Elements must always be closed. - Elements must be in lowercase. - Attribute names must be in lowercase. - Attribute values must be quoted. - Attribute minimization is forbidden. **XHTML DOCTYPE Declaration** A minimal, well-formed XHTML document: [S1] ```html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Title of document some content here... ``` **Elements Must Be Properly Nested** Correct: `Some text`. Wrong: `Some text`. [S1] **Elements Must Always Be Closed** Correct: `

This is a paragraph

`. [S1] **Empty Elements Must Also Be Closed** Self-closing tags must include a trailing slash: [S1] ```html

Happy face ``` **Elements Must Be in Lowercase** Both element names and attribute names must be lowercase. [S1] **Attribute Values Must Be Quoted** ```html Visit our HTML tutorial ``` **Attribute Minimization Is Forbidden** Use the full form: `checked="checked"` instead of bare `checked`. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) The minimal XHTML DOCTYPE document above is the canonical applied case: a complete, well-formed XHTML 1.1 page with the mandatory `xmlns`. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Well-formed XHTML skeleton: ```html Title of document some content here... ``` Self-closing empty element and full-form attribute: ```html
``` ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) - **HTML** β€” lenient; browsers ignore many markup errors and still render the page. Easier to write, less strict. [S1] - **XHTML** β€” strict, XML-based; documents must be well-formed (proper nesting, all elements closed, lowercase names, quoted values, no attribute minimization), and the DOCTYPE plus `xmlns` are mandatory. Choose XHTML when XML compatibility, extensibility, and rigorous, predictable parsing matter; choose HTML for simpler, more forgiving authoring. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) No contradictions found in the source. [S1] ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.89 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[HTML Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[HTML Introduction]], [[HTML Elements]], [[HTML Attributes]], [[HTML Entities]] - **μ°Έμ‘° λ§₯락:** Referenced when choosing between forgiving HTML and strict, XML-compliant XHTML markup. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” HTML vs XHTML β€” https://www.w3schools.com/html/html_xhtml.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "HTML vs XHTML" page (Astra wiki-curation, P-Reinforce v3.1 format).