I thought XHTML documents were supposed to be displayed with exactly the same standards compliance mode as "strict" HTML documents.
However, there is a difference in how they display pre
elements: in HTML documents, if the <pre>
start tag is followed by a LF (or CRLF), this is ignored. Not so in XHTML.
Example: a HTML file and a XHTML file that have the same content, but are rendered differently.
(Or if you think it's cheating to give a HTML file and a XHTML file exactly the same content, including DOCTYPE, here are two files that follow more classic rules: HTML 4.01 strict and XHTML 1.0 strict.)
So, does that mean that statements like this W3C page's
all line breaks and spaces are rendered exactly as they appear in the HTML. The exception is a newline immediately after the start tag <pre> and immediately before the end tag </pre>, which are discarded.
are only valid for HTML, not for XHTML? I haven't found any indication that XHTML can display things differently if it likes. But all the browsers I've tested do.