I am a little curious,
I have a link, it show different behaviour with and without following declaration:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
link with declaration:
link without declaration:
Why we need the declaration and Is the declaration affect style?
Doctype as defined in specification.
8.1.1 The DOCTYPE
A DOCTYPE is a required preamble.
DOCTYPEs are required for legacy reasons. When omitted, browsers tend
to use a different rendering mode that is incompatible with some
specifications. Including the DOCTYPE in a document ensures that the
browser makes a best-effort attempt at following the relevant specifications.
What DOCTYPE declaration does:
When performing HTML validation testing on a web page it tells the HTML (HyperText Markup Language) validator which version of (X)HTML standard the web page coding is supposed to comply with. When you validate your web page the HTML validator checks the coding against the applicable standard then reports which portions of the coding do not pass HTML validation (are not compliant).
It tells the browser how to render the page in standards compliant mode.
If DOCTYPE is not included :
You will not be able to use a HTML (HyperText Markup Language) Validator to check the page coding.
The browser rending the web page will process the coding in "quirks" mode.
The stylesheet may not be implemented as planned.