HTML and CSS Reference
In-Depth Information
mismatch: p line 11 and q
<p>Maybe you should ask somebody else?</q> Then she
Furthermore, an overlap problem may cause a parser to miss the starts or ends of other elements, and it may
not be able to recover. It is very common for overlap to cause a cascading sequence of progressively more
serious errors for the rest of the document. Thus, you should start at the beginning and fix one error at a time.
Often, fixing an overlap problem eliminates many other error messages.
Repairing overlap is not hard. Sometimes the overlap is trivial, as when the end-tag for the parent element
immediately precedes the end-tag for the child element. Then you just have to swap the end-tags. For example,
change this:
<strong><em>very important</strong></em>
to this:
<strong><em>very important</em></strong>
If the overlap extends into another element, you close the overlapping element inside its first parent and reopen
it in the last. For example, suppose you have these two paragraphs containing one quote:
<p>Sarah answered, <q>I'm really not sure about this.</p>
<p>Maybe you should ask somebody else?</q> Then she
sat down.</p>
Change them to two paragraphs, each containing a quote:
<p>Sarah answered,
<q>I'm really not sure about this.</q>
</p>
<p>
<q>Maybe you should ask somebody else?</q>
Then she sat down.
</p>
If there are intervening elements, you'll need to create new elements inside those as well.
Tidy and TagSoup can fix technical overlap problems but not especially well, and the result is usually not what
you would expect. For example, Tidy will not always reopen an overlapping element inside the next element. For
instance, it turns this:
<p>Sarah answered, <q>I'm really not sure about this.</p>
<p>Maybe you should ask somebody else?</q> Then she
sat down.</p>
into this:
<p>Sarah answered, <q>I'm really not sure about this.</p>
<p>Maybe you should ask somebody else? Then she
sat down.</p>
Search WWH ::




Custom Search