What is the use of DOCTYPE html tag | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 10

What is the use of DOCTYPE html tag

!DOCTYPE html

11th Mar 2017, 5:24 PM
Suyash Purwar
Suyash Purwar - avatar
4 Answers
+ 8
It tells the browser that the DOCument TYPE is html, which is why some browser websites I get source code from say <DOCTYPE xhtml>.
14th Mar 2017, 6:19 PM
Theprogrammers
Theprogrammers - avatar
+ 6
It tells the browser that you are using HTML5
11th Mar 2017, 6:06 PM
Chirag Bhansali
Chirag Bhansali - avatar
+ 3
This will give you more information on that https://www.w3schools.com/tags/tag_doctype.asp Though simple said, lets say your making in HTML language / website. it would start as <!DOCTYPE html> This tells the browser that your now visiting a HTML site and read and render it as it.
11th Mar 2017, 5:36 PM
Simen Daehlin
Simen Daehlin - avatar
+ 3
sorry to answer a question with a question lol. When we use HTML for the doc type, will the tag stay the same even if there is more then one version of HTML? And if the same tag stands for all the HTML types, does the tag automatically reference the latest version or would we need to do some sort of update on our computer? I'm completely new to every aspect of coding, hopefully my question makes sense
13th Mar 2017, 7:05 AM
Allanna