Could someone help me understand the difference between document type and content type of an html/xhtml page?
I know that document type is used by the browsers to determine which mode(standards/quirks) to choose and also to follow which document type schema to be used?
The HTTP Content-Type
header, for which the http-equiv="Content-Type"
HTML meta tag is a fallback only, signifies what general type of document the document is. Is it a text/html
document and should the browser fire up its HTML parser? Or is it an application/pdf
document and the browser needs to load its PDF plugin? Or is it something completely different? This header/tag should also specify the encoding the document is in, if applicable.
The HTML Document Type specifies the exact type and version of the HTML document. Is it an HTML 5 document? HTML 4 Strict? Transitional? Or just legacy tag soup?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With