why we use <!DOCTYPE HTML> in starting of HTML .what is <!doctype HTML> | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

why we use <!DOCTYPE HTML> in starting of HTML .what is <!doctype HTML>

<!doctype HTML>

29th Jun 2016, 1:53 PM
pankaj kirola
pankaj kirola - avatar
9 Answers
+ 6
They are both the same. This is like shouting to the browser "I come to you as a HTML 5 file!". This way the browser does not get confused and interpret your HTML 5 wrongly.
29th Jun 2016, 2:04 PM
Daniel Chukwuji
Daniel Chukwuji - avatar
+ 1
Do you get from the edit? It's just a declaration of the type of file.
29th Jun 2016, 2:11 PM
Daniel Chukwuji
Daniel Chukwuji - avatar
+ 1
It is just basically just to tell the computer that you are using html.
29th Jun 2016, 3:58 PM
Aritra Jana
Aritra Jana - avatar
0
I know both are same..question is what is <!doctype HTML> and why we use this
29th Jun 2016, 2:09 PM
pankaj kirola
pankaj kirola - avatar
0
and can we create HTML page without declare this
29th Jun 2016, 2:10 PM
pankaj kirola
pankaj kirola - avatar
0
thnx
29th Jun 2016, 2:14 PM
pankaj kirola
pankaj kirola - avatar
0
Ideally, no. You would only be creating issues for browsers, since HTML 5 is not the only markup language. Remember that HTML 4 has a different declaration.
29th Jun 2016, 2:14 PM
Daniel Chukwuji
Daniel Chukwuji - avatar
0
the <!doctype> declaration helps browser display a web page correctly and it is not case sensitive it defines the document type
29th Jun 2016, 2:42 PM
pankaj kirola
pankaj kirola - avatar
0
it s HTML 5 declare and it is not case sensitive
29th Jun 2016, 2:56 PM
Gokul S
Gokul S - avatar