HTML: Doctype
What is Doctype
DOCTYPE is a document type declaration, for HTML and XML.
- It must be on the first line of a file.
- It is required.
- case-insensitive for HTML.
- case-sensitive for in XML (XHTML).
HTML 5 (year 2014)
practically, use this for any html created after year 2014.
<!doctype html>
or
<!DOCTYPE html>
Old Doctypes
HTML 4.01 transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
HTML 4.01 Strict
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
HTML 4.01 Frameset
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
XHTML 1.0 transitional (Corresponding to HTML 4.01 transitional)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">