What is the meaning of the doctype declaration at the top of the html form? Is something changing?

For several years I have been writing web applications and this line:

<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Always confused me. What exactly? What are the consequences if I remove it?

I understand w3c conventions on nested elements, etc., but what really happens, why is the declaration where browsers fail or something if I take it out?

Cheers, Pete

+3
source share
4 answers

, . doctype , . . doctype , ( ) 2002-2003 , . quirks.

: doctype.

+4

doctype , HTML, . , HTML 5

0

, , . ( IE)

, DOCTYPE .

0

HTML 2.0, 3.2, 4.x XHTML 1.x:

:

:

In HTML 5:

  • This is a mystical string used to launch a document so that standards mode starts.
0
source

Source: https://habr.com/ru/post/1776734/


All Articles