• Skip to main content
  • Skip to search
    • Technologies Overview
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs
    • Browser Extensions
    • MathML
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
    • Send Feedback
    • Contribute to MDN
    • Report a content issue 🌐
    • Report a platform issue 🌐
  1. 術語表
  2. Doctype
  • Change language
  • View in English

Table of contents

  • 了解詳情

Doctype

<!DOCTYPE>會告知你的瀏覽器這個文件是用哪個版本的 HTML (或 XML)撰寫。Doctype 是一種宣告,而非 tag。你也可以把它想作「document type declaration」(文件類型宣告),或是縮寫的 「DTD」。

了解詳情

基本知識

  • 英文維基百科的 Document type declaration
  • 怪異模式與標準模式

技術參考

  • Document.doctype (en-US),以 JavaScript 回傳文件類型的方法
  • 使用多種 DTD以符合本地化

Found a problem with this page?

  • Source on GitHub
  • Report a problem with this content on GitHub
  • Want to fix the problem yourself? See our Contribution guide.

Last modified: Apr 14, 2021, by MDN contributors

Change your language
  • Web Technologies
  • Learn Web Development
  • About MDN
  • Feedback
  • About
  • MDN Web Docs Store
  • Contact Us
  • Firefox

MDN

Mozilla

© 2005-2021 Mozilla and individual contributors. Content is available under these licenses.

  • Terms
  • Privacy
  • Cookies