0

What is a DOCTYPE and why is it used?

author
subina kallyani
easy
0
337

Answer

A DOCTYPE is a declaration that tells the browser which version of HTML the page is written in.
In HTML5, it looks like this:

<!DOCTYPE html>


Why is it used?

  • It makes sure the browser renders the page in standards mode, not in old “quirks mode”.
  • This ensures your page displays consistently across different browsers.
  • Helps the browser understand how to interpret the HTML.

In short:
The DOCTYPE is a simple instruction to the browser to use modern, standard HTML rules when rendering the webpage.

Click to Reveal Answer

Tap anywhere to see the solution

Revealed

Comments0