tayiper
12-23-2006, 05:37 PM
Well, I am slowly getting frustrated. The thing is that after I've put the links on my website's index.html (http://tadej-ivan.50webs.com/index.html) page info a "definition list" and validated it the document, came out of processing with no less than 218 errors, while previously it was a valid XHTML. The errors I was getting were basically of two kinds; one for a "div" element and one for a "br" element.
The error text for the div element:
1. Error Line 48 column 192: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag.
... id="navmap1"><dt><div class="align2"><img class="icon" src="/mark.png" alt="
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.
One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
The error text for the br element:
2. Error Line 48 column 430: document type does not allow element "br" here; missing one of "dt", "dd" start-tag.
...information page</em></div></dd><br /><br /><dt><div class="align2"><img class
So I've first changed the order of "br" elements, namely I changed it from "</dd><br /><br /><dt><div class" to "</dd><dt><br /><br /><div class", and after validating it again, the error-count was reduced to 90 errors, and then after fixing some other stuff too (I don't remember exactly what it was) to 62 errors. Anyway, as you can see, this change in order of "br" elements completely fixed the second error quoted above, so I've ended up with only 24 errors total as you can see here: W3C Validator - index-test.html (http://validator.w3.org/check?uri=http%3A%2F%2Ftadej-ivan.50webs.com%2Findex-test.html).
But the problem with "div" elements remained nomather what I tried. For instance, I tried with replacing the "<div class="align2">" div class with inline "<div style="text-align: left">" variant, and later with "<span style="text-align: left">" (which surprisingly didn't move the text to the left) and so on and on. Then I remembered that I have one document from W3C stored on my hard-disk (namely the W3C - Lists in HTML documents (http://www.w3.org/TR/html4/struct/lists.html) one), and in it've read one thing that might be the reason/cause for my troubles.
The mentioned text from W3C:
Definition lists vary only slightly from other types of lists in that list items consist of two parts: a term and a description. The term is given by the DT element and is restricted to inline content. The description is given with a DD element that contains block-level content.
Therefore though I understand what the effect of this is, I am really not sure what "restricted to inline content" and "block-level content" mean in this case (and in general too), and above all, how should I deal with it??!
thanks, tayiper
The error text for the div element:
1. Error Line 48 column 192: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag.
... id="navmap1"><dt><div class="align2"><img class="icon" src="/mark.png" alt="
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.
One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
The error text for the br element:
2. Error Line 48 column 430: document type does not allow element "br" here; missing one of "dt", "dd" start-tag.
...information page</em></div></dd><br /><br /><dt><div class="align2"><img class
So I've first changed the order of "br" elements, namely I changed it from "</dd><br /><br /><dt><div class" to "</dd><dt><br /><br /><div class", and after validating it again, the error-count was reduced to 90 errors, and then after fixing some other stuff too (I don't remember exactly what it was) to 62 errors. Anyway, as you can see, this change in order of "br" elements completely fixed the second error quoted above, so I've ended up with only 24 errors total as you can see here: W3C Validator - index-test.html (http://validator.w3.org/check?uri=http%3A%2F%2Ftadej-ivan.50webs.com%2Findex-test.html).
But the problem with "div" elements remained nomather what I tried. For instance, I tried with replacing the "<div class="align2">" div class with inline "<div style="text-align: left">" variant, and later with "<span style="text-align: left">" (which surprisingly didn't move the text to the left) and so on and on. Then I remembered that I have one document from W3C stored on my hard-disk (namely the W3C - Lists in HTML documents (http://www.w3.org/TR/html4/struct/lists.html) one), and in it've read one thing that might be the reason/cause for my troubles.
The mentioned text from W3C:
Definition lists vary only slightly from other types of lists in that list items consist of two parts: a term and a description. The term is given by the DT element and is restricted to inline content. The description is given with a DD element that contains block-level content.
Therefore though I understand what the effect of this is, I am really not sure what "restricted to inline content" and "block-level content" mean in this case (and in general too), and above all, how should I deal with it??!
thanks, tayiper