Sobes.tech
Junior

What is doctype and what is it used for?

sobes.tech AI

Answer from AI

DOCTYPE is a declaration of the document type, indicating to the browser which HTML standard is used. It is necessary for the correct rendering of a web page.

Without DOCTYPE, browsers may switch to "quirks mode," which can lead to unpredictable behavior and compatibility issues in page display.

Example for HTML5:

<!DOCTYPE html>