Validation results

liunx

Guest
Can anybody shed some light on this, please. I just validated a page & got some confusing results.<br />
Here's the first:<br />
<br />
Line 6, column 5: document type does not allow element "HTML" here (explain...). <br />
<html><br />
<br />
Here's the source code:<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"<br />
"http://www.w3.org/TR/html4/loose.dtd"><br />
<br />
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><br />
<html><br />
<head><br />
<br />
My best guess here is that if you use a doctype statement that includes "html" the actual <html> tag is not needed.(?)<br />
<br />
<br />
Second thing I don't understand:<br />
<br />
Line 43, column 162: end tag for element "FONT" which is not open (explain...). <br />
...FONT COLOR=black SIZE=2>"+msg+"</FONT></TD></tr></TABLE>";<br />
<br />
This is repeated for each of the closing tags, including the /table tag. Is this just because those tags aren't necessary? That can't be... how can you get away with not closing a table? I expect it has something to do with the javascript, but I'm clueless in that area.<br />
Here is the code:<br />
<br />
var content="<TABLE WIDTH=180 BORDER=1 BORDERCOLOR=red CELLPADDING=2 CELLSPACING=0 "+"BGCOLOR="+bak+"><tr><TD ALIGN=center><FONT COLOR=black SIZE=2>"+msg+"</FONT></TD></tr></TABLE>";<br />
<br />
TIA for whatever help you can give.<!--content-->drop the font tag and use css would be my suggestion to #2 and for #1 that meta tag needs to be in your head section, after your html and head tag.<!--content-->I should've seen the meta tag location. Thanks.<br />
<br />
Want to take another look at the second problem? I get the same message for all 4 closing tags.<br />
<br />
<br />
And, hey, don't you sleep?<!--content-->I've seen that problem before, and I think it's all to do with it being in the javascript part. I didn't find a solution last time tho.<!--content-->Originally posted by DaveSW <br />
I didn't find a solution last time tho. 1) Put the JavaScript in an external file.<br />
<br />
2) Escape the '/' a la document.write ('<p>Date:', new Date().toDateString(), '<\/p>').<!--content-->Originally posted by Aronya1 <br />
I expect it has something to do with the javascript, but I'm clueless in that area.<br />
Key phrase: "I'm clueless in that area." Thanks Charles, for the suggestions. I understand what you mean in #1, even if I might not know how to accomplish it. But #2 is just Greek. I'm going to try changing the table to a div & see what happens.<!--content-->I think all he means is when you have a / - as in </p> then you need to put a \ in front of it to hide it. E.g </table> becomes <\/table><!--content-->Thanks for that, Dave. I'll try it & see what happens.<!--content-->
 
Back
Top