- Web Developer's Reference Guide
- Joshua Johanan Talha Khan Ricardo Zea
- 122字
- 2021-07-09 20:18:20
DOCTYPE
The DOCTYPE element defines the document type of the file, as follows:
<!DOCTYPE documentType>
Attributes
The documentType
attribute that you can see in the preceding code lets the browser know the type of document you will use.
Description
HTML5 has a simple document type declaration, <!DOCTYPE html>
. This lets the browser know that the document is HTML5. The previous versions of HTML needed a formal definition of the version being used, but HTML5 has removed this for simplicity.
Most browsers will enforce strict adherence to the document type declared and try and figure out what it is based on looking at the document. This can lead to rendering issues, so it is recommended that you do follow the standards.
Here is an HTML5 declaration:
<!DOCTYPE html>
推薦閱讀
- Learning Scala Programming
- Objective-C Memory Management Essentials
- 前端跨界開發指南:JavaScript工具庫原理解析與實戰
- Web交互界面設計與制作(微課版)
- Python從菜鳥到高手(第2版)
- Vue.js 3.0源碼解析(微課視頻版)
- MySQL數據庫管理與開發實踐教程 (清華電腦學堂)
- 鋒利的SQL(第2版)
- Android程序設計基礎
- Android開發案例教程與項目實戰(在線實驗+在線自測)
- Babylon.js Essentials
- C++反匯編與逆向分析技術揭秘(第2版)
- .NET Standard 2.0 Cookbook
- Scala編程實戰
- Android Game Programming by Example