- 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>
推薦閱讀
- 大學計算機基礎(第二版)
- 編程的修煉
- Boost C++ Application Development Cookbook(Second Edition)
- SpringMVC+MyBatis快速開發與項目實戰
- Twilio Best Practices
- Python程序設計案例教程
- Functional Kotlin
- 精通網絡視頻核心開發技術
- 劍指MySQL:架構、調優與運維
- Jupyter數據科學實戰
- Clojure Reactive Programming
- Python High Performance Programming
- Test-Driven Machine Learning
- 軟件體系結構
- Instant Zurb Foundation 4