Which doctype to use in an html document?

Asked

Viewed 1,165 times

-4

Guys I’m doing a course online and the first tag that appeared in the typing line was this for html, I know it’s already in version 5 and even have appeared other types of tags. I opened this question out of curiosity. It is really necessary to use this tag <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> in the opening of the HTML language or we can only use <!DOCTYPE HTM>?

2 answers

0

In HTML5 we use only <!DOCTYPE html> and is required to inform browsers that that file is an HTML.

0


In HTML5 you will use only <!DOCTYPE html>, there is no need for validation. That is, <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> is used because of the XML language validation that requires it in XHTML files.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.