The DOCTYPE declaration in HTML5 serves to

2024

The DOCTYPE declaration in HTML5 serves to

  1. A.

    specify the document type and version

  2. B.

    define the character encoding used

  3. C.

    link external stylesheets and scripts

  4. 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.

Explore the full course: Tpsc Assistant Technical Officer