Explain the purpose of doctype in HTML.

Instruction: Provide a brief explanation of what doctype is and why it's important in an HTML document.

Context: This question assesses the candidate's understanding of basic HTML structure and standards compliance. It checks if the candidate knows the significance of declaring the document type at the beginning of an HTML document.

Updated

Official answer available

Read the opening below, then unlock the full answer and practical guidance.

For a modern document served as HTML, put <!doctype html> before the document element. It is a declaration, not an HTML element or a request to download a schema.

<!doctype html> <html lang="en"> <head> <meta charset="utf-8">...

Related Questions