tags:

views:

87

answers:

2

The following snippet, with or without the DOCTYPE declaration, renders the <pre> content slightly differently, i.e., the without-DOCTYPE version renders the <pre> content with less height.

<!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" -->
<!-- "http://www.w3.org/TR/html4/strict.dtd"&gt; -->
<html>
  <head>
  </head>
  <body>
    <pre>1</pre>
  </body>
</html>

What causes this difference?

A: 

Are those supposed to be two seperate files? Does the latter have a doctype? If not it would be rendered in quirks mode.

meder
Sorry for the confusion, I've revise it.
an0
Try adding a doctype.
meder
+3  A: 
bobobobo
Hi bob,Your answer clears my thought of the question.I've revise my question into a more accurate one, so can you please revise you answer accordingly? Thanks.
an0
I think you should modify this sentence also: "So, your second example (with the plain <html> tag) renders in quirksmode because it lacks a DOCTYPE." Maybe to something like: "So your code without DOCTYPE is rendered in quirkmode ...".
an0