- 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>
推薦閱讀
- Kibana Essentials
- Android Jetpack開發:原理解析與應用實戰
- Offer來了:Java面試核心知識點精講(原理篇)
- 零基礎學Python網絡爬蟲案例實戰全流程詳解(高級進階篇)
- 大學計算機基礎實驗指導
- The Professional ScrumMaster’s Handbook
- Frank Kane's Taming Big Data with Apache Spark and Python
- ABAQUS6.14中文版有限元分析與實例詳解
- Scrapy網絡爬蟲實戰
- 基于MATLAB的控制系統仿真及應用
- MongoDB Cookbook
- C語言編程魔法書:基于C11標準
- Mastering Vim
- Flink原理深入與編程實戰:Scala+Java(微課視頻版)
- Python程序設計案例教程:從入門到機器學習(微課版)