The DOCTYPE declaration in HTML5 serves to
2024
The DOCTYPE declaration in HTML5 serves to
- A.
specify the document type and version
- B.
define the character encoding used
- C.
link external stylesheets and scripts
- D.
set the default viewport size for mobile devices
Attempted by 109 students.
Show answer & explanation
Correct answer: A
The DOCTYPE declaration in HTML5 specifies the document type and version to ensure proper rendering by browsers. It tells the browser which HTML specification the page follows, enabling standards mode instead of quirks mode.