HTML and CSS Reference
In-Depth Information
These parse trees, often called DOM (Document Object Model) trees, are the browsers'
interpretation of the markup provided and are integral to determining how to render the
page visually using both default (X)HTML style and any CSS attached. JavaScript will also
use this parse tree when scripts attempt to manipulate the document. The parse tree serves
as the skeleton of the page, so making sure that it is correct is quite important, but sadly
we'll see very often it isn't.
N OTE The syntax trees presented earlier look very similar to the parse trees, and they should,
because any particular parse tree should be derivable from the particular markup language's
content model.
Browsers are actually quite permissive in what they will render. For example, consider
the following markup:
<TITLE> Hello HTML World </title>
<!-- Simple hello malformed world -- example -->
</head>
<body>
<h1> Welcome to the World of HTML </H1>
<hr />
<p> HTML <eM> really </Em> isn't so hard!
<P> Soon you will &hearts; using HTML.
<p> You can put lots of text here if you want.
We could go on and on with fake text for you
to read, <foo> but </foo> let's get back to the topic.
</html>
This example misses important tags, doesn't specify encoding types, has a malformed
comment, uses inconsistent casing, doesn't close tags, and even uses some unknown
element foo . However, this will render exactly the same visually as the correct markup
previously presented, as shown in Figure 1-3.
Search WWH ::




Custom Search