What is the purpose of DOCTYPE in HTML?

Question

What is the purpose of DOCTYPE in HTML?

Answer

The DOCTYPE declaration tells the browser which version of HTML the document is written in,
ensuring proper rendering.

Facebook
WhatsApp
Twitter
LinkedIn
Pinterest
Scroll to Top