Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there different HTML5 doctypes?

Tags:

html

doctype

When I use to write pages in XHTML. I had 3 types of doctype - strict, transitional and frameset.

Do we have them in HTML5?

like image 811
Ashwin Avatar asked Nov 28 '22 03:11

Ashwin


2 Answers

the html5 doctype is

<!DOCTYPE html>

When you use the new HTML5 DOCTYPE, it triggers browsers to render the page in standards compliant mode.

Standards-compliant mode

  • In standards-compliant mode, the web browser assumes the page has been authored to the web content specification declared; code that does not conform to the declared standard may not display, or may display incorrectly.
  • For a web browser’s standards-compliant mode to be triggered, the webpage must have a complete document type declaration, including the URI to the document type definition (DTD).
  • There is typically less variation in webpage display between different browsers when standards-compliant mode is triggered, as the same centralised W3C specification is used as a reference when creating the web browser software.

Courtesy this link

like image 141
Talha Avatar answered Nov 29 '22 16:11

Talha


No, the HTML5 doctype

<!DOCTYPE html>

is unique, since it was chosen as the shortest doctype (string) able to turn all current browser (even IE6, afaik) in standard mode (and it can be written in upper/mixed case)

like image 22
Fabrizio Calderan Avatar answered Nov 29 '22 15:11

Fabrizio Calderan